@whoz-oss/coday-client 0.0.0-workstream-forge.284 → 0.0.0-workstream-forge.286

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/3rdpartylicenses.txt +52 -0
  2. package/browser/{chunk-BYsAPdst.js → chunk-5mGW4E0G.js} +1 -1
  3. package/browser/chunk-B4ZKQxLi.js +1 -0
  4. package/browser/chunk-B6Jjbp7r.js +1 -0
  5. package/browser/chunk-BDdxWZSD.js +2 -0
  6. package/browser/chunk-BFMfi7bN.js +1 -0
  7. package/browser/chunk-BGKOG_jF.js +1 -0
  8. package/browser/chunk-BIv3GA0j.js +1 -0
  9. package/browser/chunk-BRKEdS-H.js +1 -0
  10. package/browser/{chunk-BQrOLW8s.js → chunk-BSLGGdgS.js} +1 -1
  11. package/browser/{chunk-DB_JDbO5.js → chunk-BWOdgPpL.js} +1 -1
  12. package/browser/chunk-BYBCnWol.js +1 -0
  13. package/browser/chunk-BaZs2cqq.js +1 -0
  14. package/browser/{chunk-BXYAYYIa.js → chunk-BecFkRj3.js} +1 -1
  15. package/browser/{chunk-Bl2q9K-9.js → chunk-BgspkyJn.js} +1 -1
  16. package/browser/chunk-BtNRYep-.js +16 -0
  17. package/browser/chunk-BuupDt2w.js +1 -0
  18. package/browser/chunk-C-TFPDAn.js +1 -0
  19. package/browser/{chunk-CK-0hHs3.js → chunk-C4AQsMm0.js} +1 -1
  20. package/browser/{chunk-BbXsFpeY.js → chunk-C8kRHbPY.js} +1 -1
  21. package/browser/chunk-C9I0IDkC.js +1 -0
  22. package/browser/chunk-C9Im1XQZ.js +1 -0
  23. package/browser/chunk-CBa63htl.js +1 -0
  24. package/browser/chunk-CR2ZgYm1.js +1 -0
  25. package/browser/chunk-CTnGJhEu.js +1 -0
  26. package/browser/chunk-CV72_wbg.js +690 -0
  27. package/browser/chunk-Cgng0NyG.js +1 -0
  28. package/browser/chunk-Cht3Sl44.js +1 -0
  29. package/browser/chunk-CpXnuzhL.js +1 -0
  30. package/browser/chunk-Cw_G-BTP.js +1 -0
  31. package/browser/chunk-D48e7Jxo.js +2 -0
  32. package/browser/chunk-DEd4dYEy.js +1 -0
  33. package/browser/chunk-DII4lC8r.js +1 -0
  34. package/browser/chunk-DTHI-QLx.js +61 -0
  35. package/browser/chunk-DUksmlzj.js +1 -0
  36. package/browser/chunk-DWnk-InR.js +1 -0
  37. package/browser/{chunk-DM86JaK-.js → chunk-DZzoCiPa.js} +1 -1
  38. package/browser/chunk-Da_8VPJd.js +1 -0
  39. package/browser/chunk-DeS6UHdw.js +1 -0
  40. package/browser/{chunk-BxyolXEz.js → chunk-DtO-loh9.js} +1 -1
  41. package/browser/chunk-DvgyKpON.js +2 -0
  42. package/browser/chunk-O_4Rn5qq.js +1 -0
  43. package/browser/chunk-RNbGWl1w.js +1 -0
  44. package/browser/chunk-YSYGmtzS.js +1 -0
  45. package/browser/chunk-cs0QcDnt.js +1 -0
  46. package/browser/chunk-gOvITjLx.js +1 -0
  47. package/browser/{chunk-BEjdqTuv.js → chunk-hqzAiSeU.js} +1 -1
  48. package/browser/chunk-spovbUSX.js +1 -0
  49. package/browser/chunk-wS9pwsFZ.js +1 -0
  50. package/browser/index.html +1 -1
  51. package/browser/main-2W2EKPFF.js +1253 -0
  52. package/package.json +1 -1
  53. package/browser/chunk-0JbcW6XU.js +0 -1
  54. package/browser/chunk-Bb-c0ROH.js +0 -1
  55. package/browser/chunk-BdGvps3l.js +0 -1
  56. package/browser/chunk-BiVIEQ9a.js +0 -1
  57. package/browser/chunk-BiZzqeAP.js +0 -1
  58. package/browser/chunk-BkYVWjXM.js +0 -1
  59. package/browser/chunk-Bl_O73CB.js +0 -1
  60. package/browser/chunk-Bw6tipQO.js +0 -1
  61. package/browser/chunk-C1XiLUJe.js +0 -1
  62. package/browser/chunk-CCAHEyrn.js +0 -1
  63. package/browser/chunk-CKVl5Clw.js +0 -1
  64. package/browser/chunk-CMLKq_d1.js +0 -1
  65. package/browser/chunk-CUuUezdS.js +0 -2
  66. package/browser/chunk-Cfwcs5Kc.js +0 -1
  67. package/browser/chunk-Csvi_3to.js +0 -1
  68. package/browser/chunk-CxGh-OSF.js +0 -1
  69. package/browser/chunk-Cz-Jz4NK.js +0 -1
  70. package/browser/chunk-D4hFKIuc.js +0 -1
  71. package/browser/chunk-D8p-F6vy.js +0 -1
  72. package/browser/chunk-DCI35EBd.js +0 -1
  73. package/browser/chunk-DEGiKLCd.js +0 -1
  74. package/browser/chunk-DJVPAAOR.js +0 -1
  75. package/browser/chunk-DNMiaqnS.js +0 -2
  76. package/browser/chunk-DQzepkz_.js +0 -1
  77. package/browser/chunk-DTUbUaG8.js +0 -1
  78. package/browser/chunk-DV9A52hr.js +0 -2
  79. package/browser/chunk-Dm98JW0v.js +0 -1
  80. package/browser/chunk-TljffFCf.js +0 -1
  81. package/browser/chunk-Yh9s3GFa.js +0 -1
  82. package/browser/chunk-YmtXKFPm.js +0 -1
  83. package/browser/chunk-gJxWDxbF.js +0 -1
  84. package/browser/chunk-idHJ_h4K.js +0 -1
  85. package/browser/chunk-iiXgVxfs.js +0 -1
  86. package/browser/chunk-qF4-8qpt.js +0 -671
  87. package/browser/chunk-rqfGv-7x.js +0 -1
  88. package/browser/chunk-tlmUd1Et.js +0 -1
  89. package/browser/main-C2L5IBU7.js +0 -1253
@@ -638,6 +638,58 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
638
638
  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
639
639
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
640
640
 
641
+ --------------------------------------------------------------------------------
642
+ Package: turndown
643
+ License: "MIT"
644
+
645
+ MIT License
646
+
647
+ Copyright (c) 2017 Dom Christie
648
+
649
+ Permission is hereby granted, free of charge, to any person obtaining a copy
650
+ of this software and associated documentation files (the "Software"), to deal
651
+ in the Software without restriction, including without limitation the rights
652
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
653
+ copies of the Software, and to permit persons to whom the Software is
654
+ furnished to do so, subject to the following conditions:
655
+
656
+ The above copyright notice and this permission notice shall be included in all
657
+ copies or substantial portions of the Software.
658
+
659
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
660
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
661
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
662
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
663
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
664
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
665
+ SOFTWARE.
666
+
667
+ --------------------------------------------------------------------------------
668
+ Package: turndown-plugin-gfm
669
+ License: "MIT"
670
+
671
+ MIT License
672
+
673
+ Copyright (c) 2017 Dom Christie
674
+
675
+ Permission is hereby granted, free of charge, to any person obtaining a copy
676
+ of this software and associated documentation files (the "Software"), to deal
677
+ in the Software without restriction, including without limitation the rights
678
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
679
+ copies of the Software, and to permit persons to whom the Software is
680
+ furnished to do so, subject to the following conditions:
681
+
682
+ The above copyright notice and this permission notice shall be included in all
683
+ copies or substantial portions of the Software.
684
+
685
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
686
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
687
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
688
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
689
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
690
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
691
+ SOFTWARE.
692
+
641
693
  --------------------------------------------------------------------------------
642
694
  Package: @angular/forms
643
695
  License: "MIT"
@@ -1 +1 @@
1
- import {g,aK as ue,a6 as x}from'./main-C2L5IBU7.js';var o=class r{skillController=g(ue);getById(l){return this.skillController.getByIdSkill(l)}listPlatform(){return this.skillController.listPlatformSkill()}listByNamespace(l){return this.skillController.listByParentSkill(l)}listEffective(l){return this.skillController.listEffectiveSkill(l)}create(l){return this.skillController.createSkill(l)}update(l,e){return this.skillController.updateSkill(l,e)}delete(l){return this.skillController.deleteSkill(l)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{o};
1
+ import {g,aK as ue,a6 as A}from'./main-2W2EKPFF.js';var o=class r{skillController=g(ue);getById(l){return this.skillController.getByIdSkill(l)}listPlatform(){return this.skillController.listPlatformSkill()}listByNamespace(l){return this.skillController.listByParentSkill(l)}listEffective(l){return this.skillController.listEffectiveSkill(l)}create(l){return this.skillController.createSkill(l)}update(l,e){return this.skillController.updateSkill(l,e)}delete(l){return this.skillController.deleteSkill(l)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})};export{o};
@@ -0,0 +1 @@
1
+ import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-DtO-loh9.js';import {g,W,K as we,z as zi,U,N as Nw,I as Is,a as hg,Y as Yw,m as ml,Q as QE,b as Qw,H as HC,p as dC,L as Lg}from'./main-2W2EKPFF.js';import {v as vn,d as yn,k as dn,_ as _n,m as mn,A as Ao}from'./chunk-CV72_wbg.js';import'./chunk-gOvITjLx.js';function O(r,e){r&1&&(Is(0,"p",1),HC(1,"Loading integration\u2026"),ml());}function T(r,e){r&1&&(Is(0,"ds-notice"),HC(1,"Failed to load this integration configuration."),ml());}function L(r,e){r&1&&(Is(0,"div",3)(1,"ds-tag",9),HC(2,"YAML"),ml(),Is(3,"ds-tag",10),HC(4,"Read-only"),ml()());}function k(r,e){if(r&1&&(Is(0,"ds-card",2),Yw(1,L,5,0,"div",3),Is(2,"dl",4)(3,"dt"),HC(4,"Name"),ml(),Is(5,"dd"),HC(6),ml(),Is(7,"dt"),HC(8,"Type"),ml(),Is(9,"dd",5),HC(10),ml(),Is(11,"dt"),HC(12,"Description"),ml(),Is(13,"dd"),HC(14),ml(),Is(15,"dt"),HC(16,"Scope"),ml(),Is(17,"dd"),HC(18),ml(),Is(19,"dt"),HC(20,"Source"),ml(),Is(21,"dd"),HC(22),ml(),Is(23,"dt"),HC(24,"Auto grant"),ml(),Is(25,"dd"),HC(26),ml(),Is(27,"dt"),HC(28,"Auth setting"),ml(),Is(29,"dd"),HC(30),ml()()(),Is(31,"ds-card",6)(32,"p",7),HC(33,"Sensitive values are always redacted."),ml(),Is(34,"pre",8),HC(35),ml()()),r&2){let o=e,a=dC();QE(),Qw(a.source()==="FILESYSTEM"?1:-1),QE(5),Lg(o.name),QE(4),Lg(o.integrationType),QE(4),Lg(o.description||"\u2014"),QE(4),Lg(a.scopeOf(o)),QE(4),Lg(a.source()),QE(4),Lg(o.autoGrant?"Enabled":"Disabled"),QE(4),Lg(o.authSettingName||"None"),QE(5),Lg(a.parameters());}}var w="\u2022\u2022\u2022\u2022\u2022\u2022",A=/(?:api[-_]?key|token|secret|password|passphrase|credential|private[-_]?key|client[-_]?secret|authorization|cookie)/i,V=class r{route=g(W);destroyRef=g(we);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=zi(true);hasError=zi(false);config=zi(null);source=zi("NEO4J");parameters=zi("{}");ngOnInit(){this.state.getById(this.integrationId).pipe(U(this.destroyRef)).subscribe({next:e$1=>{this.config.set(e$1),this.source.set(e(e$1)),this.parameters.set(JSON.stringify(this.redact(e$1.parameters),null,2)),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}scopeOf(e){let o=e.userId?e.namespaceId?"userOnNs":"userGlobal":e.namespaceId?"namespace":"platform";return {platform:"Platform",namespace:"Namespace",userOnNs:"Personal on namespace",userGlobal:"Personal global"}[o]}redact(e,o=""){return A.test(o)?w:e===null||typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?this.containsCredential(e)?w:e:Array.isArray(e)?e.map(a=>this.redact(a,o)):typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,m])=>[a,this.redact(m,a)])):String(e??"")}containsCredential(e){return /^(?:bearer\s+|basic\s+|sk[-_]|gh[opusr]_|xox[baprs]-|-----begin (?:rsa |ec |openssh )?private key-----)/i.test(e.trim())}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=Nw({type:r,selectors:[["agentos-integration-config-view"]],decls:5,vars:1,consts:[["title","Integration configuration"],["role","status",1,"ds-hint"],["heading","General"],[1,"settings-table__tags"],["dsDefinitionList",""],[1,"ds-mono"],["heading","Parameters"],[1,"ds-hint"],[1,"ds-pre"],["variant","neutral"],["variant","outline"]],template:function(o,a){if(o&1&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Yw(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),ml()),o&2){let m;QE(2),Qw(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[vn,yn,dn,_n,mn,Ao],encapsulation:2})};export{V as IntegrationConfigViewComponent};
@@ -0,0 +1 @@
1
+ import {c}from'./chunk-BgspkyJn.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-CV72_wbg.js';import {g,F,K as we,z as zi,U as U$1,ai as Fe,al as We,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,s as sC,q as mf,r as yf,i as fg}from'./main-2W2EKPFF.js';var M=(n,t)=>t.id??t.name;function U(n,t){if(n&1&&(Is(0,"p",3),HC(1),ml()),n&2){let e=dC();QE(),Lg(e.deletion.error());}}function B(n,t){n&1&&(Is(0,"p",4),HC(1,"Loading scheduled prompts\u2026"),ml());}function j(n,t){n&1&&(Is(0,"p",5),HC(1,"No platform scheduled prompts defined yet."),ml());}function W(n,t){n&1&&(Is(0,"p",4),HC(1,"No scheduled prompts match the current filter."),ml());}function H(n,t){if(n&1&&(Is(0,"span",14),HC(1),ml()),n&2){let e=dC().$implicit;QE(),Lg(e.description);}}function O(n,t){if(n&1){let e=sC();Is(0,"button",21),Eg("click",function(){mf(e);let s=dC().$implicit,c=dC(2);return yf(c.toggle(s))}),HC(1),ml(),Is(2,"button",21),Eg("click",function(){mf(e);let s=dC().$implicit,c=dC(2);return yf(c.edit(s))}),HC(3,"Edit"),ml();}if(n&2){let e=dC().$implicit;QE(),Lg(e.enabled?"Disable":"Enable"),QE(),fg("aria-label","Edit "+e.name);}}function Y(n,t){if(n&1){let e=sC();Is(0,"agentos-row-delete-action",22),Eg("deleteRequested",function(){mf(e);let s=dC().$implicit,c=dC(2);return yf(c.deletion.request(s.id))})("deleteConfirmed",function(){mf(e);let s=dC().$implicit,c=dC(2);return yf(c.confirmDelete(s))})("deleteCancelled",function(){mf(e);let s=dC(3);return yf(s.deletion.cancel())}),ml();}if(n&2){let e=dC().$implicit,i=dC(2);pg("rowKey",e.id)("rowLabel",e.name)("state",i.deletion);}}function z(n,t){if(n&1&&(Is(0,"tr",9)(1,"td",12)(2,"span",13),HC(3),ml(),Yw(4,H,2,1,"span",14),ml(),Is(5,"td",15),HC(6),ml(),Is(7,"td",16)(8,"ds-tag",17),HC(9),ml()(),Is(10,"td",18)(11,"div",19),Yw(12,O,4,2),Yw(13,Y,1,3,"agentos-row-delete-action",20),ml()()()),n&2){let e=t.$implicit,i=dC(2);QE(3),Lg(e.name),QE(),Qw(e.description?4:-1),QE(2),Lg(i.scheduleLabel(e)),QE(2),pg("variant",e.enabled?"accent":"outline"),QE(),Lg(e.enabled?"Enabled":"Disabled"),QE(3),Qw(i.deletion.confirmingId()!==e.id?12:-1),QE(),Qw(e.id?13:-1);}}function G(n,t){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"Schedule"),ml(),Is(8,"th",10),HC(9,"Status"),ml(),Is(10,"th",10)(11,"span",11),HC(12,"Actions"),ml()()()(),Is(13,"tbody",8),Jw(14,z,14,7,"tr",9,M),ml()()()),n&2){let e=dC();QE(14),eC(e.rowFilter.filteredRows());}}var A=class n{router=g(F);destroyRef=g(we);state=g(c);prompts=zi([]);isLoading=zi(true);deletion=k();rowFilter=O$1(this.prompts,t=>[t.name,t.description,this.scheduleLabel(t),t.enabled?"Enabled":"Disabled"].filter(Boolean).join(" "));constructor(){this.state.listPlatform().pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.prompts.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}scheduleLabel(t){let{recurrence:e}=t,i=e.unit===Fe.WEEK?"week":"month",s=e.unit===Fe.WEEK&&e.days?.length?` (${e.days.map(c=>We[c]??c).join(", ")})`:"";return `Every ${i}${s} at ${e.timeUtc} UTC`}openCreateForm(){this.router.navigate(["/agentos","admin","scheduled-prompts","new"]);}edit(t){t.id&&this.router.navigate(["/agentos","admin","scheduled-prompts",t.id,"edit"]);}toggle(t){(t.enabled?this.state.disable(t.id??""):this.state.enable(t.id??"")).pipe(U$1(this.destroyRef)).subscribe(i=>this.patchPrompt(i));}confirmDelete(t){if(!t.id)return;let e=t.id;this.deletion.execute(e,{request$:this.state.delete(e).pipe(U$1(this.destroyRef)),onSuccess:()=>this.prompts.update(i=>i.filter(s=>s.id!==e)),errorMessage:`Deleting "${t.name}" failed. Try again.`});}patchPrompt(t){this.prompts.update(e=>e.map(i=>i.id===t.id?t:i));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Nw({type:n,selectors:[["agentos-platform-scheduled-prompts"]],decls:9,vars:3,consts:[["title","Platform scheduled prompts","description","Scheduled prompts shared across every namespace."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(e,i){e&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return i.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),HC(3,"New scheduled prompt"),ml()(),Yw(4,U,2,1,"p",3),Yw(5,B,2,0,"p",4)(6,j,2,0,"p",5)(7,W,2,0,"p",4)(8,G,16,0,"div",6)),e&2&&(QE(),pg("query",i.rowFilter.query()),QE(3),Qw(i.deletion.error()?4:-1),QE(),Qw(i.isLoading()?5:i.prompts().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{A as PlatformScheduledPromptsComponent};
@@ -0,0 +1,2 @@
1
+ import {I}from'./chunk-DEd4dYEy.js';import {g,W,aX as L,K as we,z as zi,j as mT,aY as Ue,ac as Ny,U,a2 as ga,aa as _r,N as Nw,I as Is,a as hg,Y as Yw,m as ml,R as Eg,Q as QE,b as Qw,P as pg,H as HC,s as sC,S as BI,J as Jw,p as dC,T as HI,k as eC,o as Il,as as jg,q as mf,r as yf,L as Lg}from'./main-2W2EKPFF.js';import {a6 as gd,M as Mo,D as Do,U as Ut,o as Mn,Q as Qt,c as fo,a8 as _a,ac as Bi,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at,u as un,n as cn}from'./chunk-CV72_wbg.js';import'./chunk-gOvITjLx.js';var oe=(i,t)=>t.id;function ae(i,t){i&1&&(Is(0,"p",1),HC(1,"Loading\u2026"),ml());}function se(i,t){if(i&1&&(Is(0,"ds-notice"),HC(1),ml()),i&2){let e=dC(2);QE(),Lg(e.errorMessage());}}function re(i,t){if(i&1){let e=sC();Is(0,"div")(1,"button",23),Eg("click",function(){mf(e);let s=dC(2);return yf(s.retryLoad())}),HC(2,"Retry loading"),ml()();}}function ce(i,t){if(i&1&&(hg(0,"br"),HC(1)),i&2){let e=dC(3);QE(),Il("",e.association()?.checkoutFailureReason," ");}}function de(i,t){if(i&1&&(Is(0,"ds-notice",3),HC(1),Yw(2,ce,2,1),ml()),i&2){let e=dC(2);pg("tone",e.checkoutStatus()===e.CheckoutStatus.FAILED?"error":e.checkoutStatus()===e.CheckoutStatus.READY?"success":"neutral"),QE(),Il(" Repository: ",e.checkoutStatus()," "),QE(),Qw(e.association()?.checkoutFailureReason?2:-1);}}function le(i,t){if(i&1&&(Is(0,"option",12),HC(1),ml()),i&2){let e=t.$implicit,c=dC(2);pg("value",e.id),QE(),jg("",e.name," (",c.authTypeLabel(e.authType),")");}}function me(i,t){i&1&&(Is(0,"p",13),HC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),ml());}function pe(i,t){if(i&1){let e=sC();Is(0,"button",24),Eg("click",function(){mf(e);let s=dC(2);return yf(s.remove())}),HC(1," Remove association "),ml();}if(i&2){let e=dC(2);pg("disabled",!e.associationLoaded()||e.isSaving());}}function ue(i,t){if(i&1){let e=sC();Yw(0,se,2,1,"ds-notice"),Yw(1,re,3,0,"div"),Yw(2,de,3,3,"ds-notice",3),Is(3,"ds-fieldset",4)(4,"ds-form-field",5)(5,"input",6),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.repositoryUrl.set(s))}),ml(),BI(),ml(),Is(6,"ds-form-field",7)(7,"input",8),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.mainBranch.set(s))}),ml(),BI(),ml(),Is(8,"ds-form-field",9)(9,"select",10),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.serviceAuthSettingId.set(s))}),Is(10,"option",11),HC(11,"Select an auth setting\u2026"),ml(),Jw(12,le,2,3,"option",12,oe),ml(),BI(),Yw(14,me,2,0,"p",13),ml()(),Is(15,"ds-fieldset",14)(16,"div",15)(17,"label",16)(18,"input",17),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.autoWorktree.set(s))}),ml(),BI(),HC(19," Offer a worktree to every new top-level case "),ml(),Is(20,"p",18),HC(21," The creator checks the box when creating the case; it is unchecked by default, and a case created without it has no Git. Applies to cases created from now on: turning this on later never equips existing cases, and turning it off never removes a worktree already created. "),ml()(),Is(22,"ds-form-field",19)(23,"input",20),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.setupCommand.set(s))}),ml(),BI(),Is(24,"p",13),HC(25," Runs on the server, as the service user, in each new worktree. It executes code from the branch \u2014 prefer a command that disables lifecycle scripts. "),ml()()(),Is(26,"ds-form-actions")(27,"button",21),Eg("click",function(){mf(e);let s=dC();return yf(s.save())}),HC(28),ml(),Yw(29,pe,2,1,"button",22),ml();}if(i&2){let e=dC();Qw(e.errorMessage()?0:-1),QE(),Qw(e.associationLoaded()?-1:1),QE(),Qw(e.isAssociated()&&e.checkoutStatus()?2:-1),QE(),pg("disabled",!e.associationLoaded()||e.isSaving()),QE(2),pg("ngModel",e.repositoryUrl()),HI(),QE(2),pg("ngModel",e.mainBranch()),HI(),QE(2),pg("ngModel",e.serviceAuthSettingId()),HI(),QE(3),eC(e.eligibleAuthSettings()),QE(2),Qw(e.eligibleAuthSettings().length===0?14:-1),QE(),pg("disabled",!e.associationLoaded()||e.isSaving()),QE(3),pg("ngModel",e.autoWorktree()),HI(),QE(5),pg("ngModel",e.setupCommand()),HI(),QE(4),pg("disabled",!e.canSave()),QE(),Il(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),QE(),Qw(e.isAssociated()?29:-1);}}var ge=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],he={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},ne=class i{route=g(W);gitApi=g(L);authSettingState=g(I);destroyRef=g(we);isLoading=zi(true);isSaving=zi(false);confirmingRemove=zi(false);associationLoaded=zi(false);errorMessage=zi(null);association=zi(null);authSettings=zi([]);repositoryUrl=zi("");mainBranch=zi("main");serviceAuthSettingId=zi("");autoWorktree=zi(false);setupCommand=zi("");namespaceId="";isAssociated=mT(()=>this.association()?.associated===true);eligibleAuthSettings=mT(()=>this.authSettings().filter(t=>ge.includes(t.authType)));authTypeLabel(t){return he[t??""]??t??"unknown"}canSave=mT(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=mT(()=>this.association()?.checkoutStatus??null);CheckoutStatus=Ue;ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}retryLoad(){this.isLoading()||this.isSaving()||this.load();}load(){this.isLoading.set(true),this.associationLoaded.set(false),this.errorMessage.set(null),Ny({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({association:t,authSettings:e})=>{this.authSettings.set(e??[]),this.acceptAssociation(t),this.isLoading.set(false);},error:t=>{console.error("Failed to load the Git repository settings",t),this.errorMessage.set(this.messageOf(t)),this.isLoading.set(false);}});}acceptAssociation(t){this.association.set(t);let e=t?.associated===false||t?.associated===true&&typeof t.repositoryUrl=="string"&&typeof t.mainBranch=="string"&&typeof t.serviceAuthSettingId=="string"&&typeof t.autoWorktreeForRootCases=="boolean"&&(t.setupCommand==null||typeof t.setupCommand=="string");this.associationLoaded.set(e),e?this.applyToForm(t):this.errorMessage.set("The repository settings could not be loaded completely. Retry before making changes.");}applyToForm(t){this.repositoryUrl.set(t.repositoryUrl??""),this.mainBranch.set(t.mainBranch??"main"),this.serviceAuthSettingId.set(t.serviceAuthSettingId??""),this.autoWorktree.set(t.autoWorktreeForRootCases??false),this.setupCommand.set(t.setupCommand??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId(),autoWorktreeForRootCases:this.autoWorktree(),setupCommand:this.setupCommand().trim()||void 0}).pipe(U(this.destroyRef),ga(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),_r(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||this.confirmingRemove.set(true);}confirmRemove(){this.confirmingRemove.set(false),!(!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated())&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),ga(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),_r(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Nw({type:i,selectors:[["agentos-namespace-git"]],decls:5,vars:2,consts:[["title","Git repository","description","Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, the new-case form offers a worktree, and a case created with one gets a repo/ directory shared by its sub-cases. Namespace files remain shared documents outside Git. Agents create branches and pull requests in their workflows."],[1,"ds-hint"],["title","Remove the repository association?","message","Existing workspaces keep their worktree.","confirmLabel","Remove","cancelLabel","Cancel",3,"confirmed","cancelled","open"],[3,"tone"],["legend","Repository",3,"disabled"],["label","Repository URL","controlId","git-url","hint","HTTPS only, without credentials in the URL."],["dsControl","","id","git-url","type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",3,"ngModelChange","ngModel"],["label","Main branch","controlId","git-branch","hint","New worktrees start at this branch\u2019s commit, without creating a branch."],["dsControl","","id","git-branch","type","text","placeholder","main","name","mainBranch",3,"ngModelChange","ngModel"],["label","Service account","controlId","git-auth","hint","Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case."],["dsControl","","id","git-auth","name","serviceAuthSettingId",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"ds-hint","ds-hint--warning"],["legend","Automation",3,"disabled"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],[1,"ds-hint","ds-indent"],["label","Setup command (optional)","controlId","git-setup"],["dsControl","","mono","","id","git-setup","type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",3,"ngModelChange","ngModel"],["id","git-save","dsButton","","variant","primary","type","button",3,"click","disabled"],["id","git-remove","dsButton","","variant","danger","type","button",3,"disabled"],["id","git-retry","dsButton","","type","button",3,"click"],["id","git-remove","dsButton","","variant","danger","type","button",3,"click","disabled"]],template:function(e,c){e&1&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Yw(2,ae,2,0,"p",1)(3,ue,30,14),ml(),Is(4,"ds-confirm-dialog",2),Eg("confirmed",function(){return c.confirmRemove()})("cancelled",function(){return c.confirmingRemove.set(false)}),ml()),e&2&&(QE(2),Qw(c.isLoading()?2:3),QE(2),pg("open",c.confirmingRemove()));},dependencies:[gd,Mo,Do,Ut,Mn,Qt,fo,_a,Bi,vn,yn,fn,pn,hn,_n,at,un,cn],encapsulation:2})};
2
+ export{ne as NamespaceGitComponent};
@@ -0,0 +1 @@
1
+ import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-CV72_wbg.js';import {g,F,K as we,ag as U$1,$ as Sr,z as zi,a1 as ma,U as U$2,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,o as Il,s as sC,q as mf,r as yf,i as fg}from'./main-2W2EKPFF.js';var B=(n,e)=>e.id??e.name;function j(n,e){if(n&1&&(Is(0,"p",3),HC(1),ml()),n&2){let t=dC();QE(),Lg(t.deletion.error());}}function K(n,e){n&1&&(Is(0,"p",4),HC(1,"Loading agent configs\u2026"),ml());}function H(n,e){n&1&&(Is(0,"p",5),HC(1,"No platform agent configs defined yet."),ml());}function U(n,e){n&1&&(Is(0,"p",4),HC(1,"No agent configs match the current filter."),ml());}function z(n,e){if(n&1){let t=sC();Is(0,"button",19),Eg("click",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.inspect(d))}),HC(1," Inspect "),ml(),Is(2,"button",19),Eg("click",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.edit(d))}),HC(3,"Edit"),ml();}if(n&2){let t=dC().$implicit;fg("aria-label","Inspect "+t.name),QE(2),fg("aria-label","Edit "+t.name);}}function G(n,e){if(n&1){let t=sC();Is(0,"agentos-row-delete-action",20),Eg("deleteRequested",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.deletion.request(d.id))})("deleteConfirmed",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.confirmDelete(d))})("deleteCancelled",function(){mf(t);let d=dC(3);return yf(d.deletion.cancel())}),ml();}if(n&2){let t=dC().$implicit,a=dC(2);pg("rowKey",t.id)("rowLabel",t.name)("state",a.deletion);}}function J(n,e){if(n&1&&(Is(0,"tr",9)(1,"td",12),HC(2),ml(),Is(3,"td",13),HC(4),ml(),Is(5,"td",14),HC(6),ml(),Is(7,"td",15),HC(8),ml(),Is(9,"td",16)(10,"div",17),Yw(11,z,4,2),Yw(12,G,1,3,"agentos-row-delete-action",18),ml()()()),n&2){let t=e.$implicit,a=dC(2);QE(2),Lg(t.name),QE(2),Il(" ",t.description||"\u2014"," "),QE(2),Lg(t.modelName||"\u2014"),QE(2),Lg(a.mode(t)),QE(3),Qw(a.deletion.confirmingId()!==t.id?11:-1),QE(),Qw(t.id?12:-1);}}function O(n,e){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"Description"),ml(),Is(8,"th",10),HC(9,"Model"),ml(),Is(10,"th",10),HC(11,"Execution mode"),ml(),Is(12,"th",10)(13,"span",11),HC(14,"Actions"),ml()()()(),Is(15,"tbody",8),Jw(16,J,13,6,"tr",9,B),ml()()()),n&2){let t=dC();QE(16),eC(t.rowFilter.filteredRows());}}var I=class n{router=g(F);destroyRef=g(we);agentConfigController=g(U$1);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();configs=zi([]);rowFilter=O$1(this.configs,e=>[e.name,e.description,e.modelName,this.mode(e)].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.agentConfigController.listPlatformAgentsAgentConfig(true))),U$2(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}mode(e){return e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE")}openCreateForm(){this.router.navigate(["/agentos","admin","agent-configs","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.agentConfigController.deleteAgentConfig(e.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Nw({type:n,selectors:[["agentos-platform-agent-configs"]],decls:9,vars:3,consts:[["title","Platform agents","description","Agent configurations shared across every namespace."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform agents"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Model"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return a.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return a.openCreateForm()}),HC(3,"New agent config"),ml()(),Yw(4,j,2,1,"p",3),Yw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,18,0,"div",6)),t&2&&(QE(),pg("query",a.rowFilter.query()),QE(3),Qw(a.deletion.error()?4:-1),QE(),Qw(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{I as PlatformAgentConfigsComponent};
@@ -0,0 +1 @@
1
+ import {p as pt,T as Te,b as bn,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,E as Ea}from'./chunk-CV72_wbg.js';import {g,W,F,K as we,aq as F$1,ap as k,a9 as F$2,a2 as ga,aa as _r,ar as Ne,j as mT,z as zi,n as Ff,U,O as x,M as w,N as Nw,I as Is,R as Eg,H as HC,m as ml,Y as Yw,Q as QE,P as pg,b as Qw,s as sC,a as hg,S as BI,J as Jw,ao as Xw,p as dC,T as HI,k as eC,o as Il,ae as qw,L as Lg,as as jg,q as mf,r as yf}from'./main-2W2EKPFF.js';function he(r,t){r&1&&(Is(0,"p",2),HC(1,"Loading\u2026"),ml());}function ve(r,t){if(r&1&&hg(0,"input",6),r&2){let e=dC(2);pg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Is(0,"option",44),HC(1),ml()),r&2){let e=t.$implicit;pg("value",e.id),QE(),jg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Is(0,"select",7)(1,"option",43),HC(2,"Select provider"),ml(),Jw(3,ye,2,3,"option",44,qw().trackByProvider,true),ml(),BI()),r&2){let e=dC(2);pg("formControl",e.aiProviderIdControl),HI(),QE(3),eC(e.providers());}}function xe(r,t){if(r&1&&(Is(0,"option",25),HC(1),ml()),r&2){let e=t.$implicit;pg("ngValue",e),QE(),Lg(e.toLowerCase());}}function _e(r,t){r&1&&(Is(0,"p",2),HC(1,"Not supported yet for Anthropic and Gemini providers."),ml());}function Me(r,t){r&1&&(Is(0,"p",2),HC(1," Sent as is to OpenAI-compatible providers, which reject levels the model does not support. Through Requesty, Claude models do not apply it faithfully. "),ml());}function Ee(r,t){r&1&&(Is(0,"p",26),HC(1," OpenAI reasoning models (GPT-5.1 and later) reject a temperature other than 1 with an effort: leave Temperature empty or set it to 1. "),ml());}function Ae(r,t){if(r&1){let e=sC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let u=dC();return yf(u.submit())}),Is(1,"ds-form-field",5),Yw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),ml(),Is(4,"ds-form-field",8),hg(5,"input",9),BI(),ml(),Is(6,"ds-form-field",10),hg(7,"input",11),BI(),ml(),Is(8,"ds-form-field",12),hg(9,"input",13),BI(),ml(),Is(10,"ds-form-field",14),hg(11,"input",15),BI(),ml(),Is(12,"div",16)(13,"ds-form-field",17),hg(14,"input",18),BI(),ml(),Is(15,"ds-form-field",19),hg(16,"input",20),BI(),ml()(),Is(17,"ds-form-field",21),hg(18,"input",22),BI(),ml(),Is(19,"ds-form-field",23)(20,"select",24)(21,"option",25),HC(22,"Provider default"),ml(),Jw(23,xe,2,2,"option",25,Xw),ml(),BI(),Yw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Yw(27,Ee,2,0,"p",26),ml(),Is(28,"div",27)(29,"label",28),hg(30,"input",29),BI(),Is(31,"span",30),HC(32,"Supports advanced execution"),ml()(),Is(33,"p",31),HC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),ml()(),Is(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),hg(38,"input",34),BI(),ml(),Is(39,"ds-form-field",35),hg(40,"input",36),BI(),ml()(),Is(41,"div",16)(42,"ds-form-field",37),hg(43,"input",38),BI(),ml(),Is(44,"ds-form-field",39),hg(45,"input",40),BI(),ml()()(),Is(46,"ds-form-actions")(47,"button",41),HC(48),ml(),Is(49,"button",42),Eg("click",function(){mf(e);let u=dC();return yf(u.cancel())}),HC(50,"Cancel"),ml()()();}if(r&2){let e=dC();pg("formGroup",e.form),QE(2),Qw(e.isEditMode()?2:3),QE(3),pg("formControl",e.apiModelNameControl),HI(),QE(2),pg("formControl",e.descriptionControl),HI(),QE(2),pg("formControl",e.aliasControl),HI(),QE(2),pg("formControl",e.priorityControl),HI(),QE(3),pg("formControl",e.temperatureControl),HI(),QE(2),pg("formControl",e.contextWindowControl),HI(),QE(2),pg("formControl",e.maxCompletionTokensControl),HI(),QE(2),pg("formControl",e.reasoningEffortControl),HI(),QE(),pg("ngValue",null),QE(2),eC(e.reasoningEffortOptions),QE(2),Qw(e.reasoningEffortUnsupported()?25:26),QE(2),Qw(e.temperatureMayConflictWithEffort()?27:-1),QE(3),pg("formControl",e.supportsAdvancedExecutionControl),HI(),QE(5),pg("formGroup",e.pricingGroup),QE(3),HI(),QE(2),HI(),QE(3),HI(),QE(2),HI(),QE(2),pg("disabled",e.form.invalid||e.isSubmitting()),QE(),Il(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(F$1);aiProviderController=g(k);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ga(()=>_r([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[bn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get reasoningEffortControl(){return this.form.controls.reasoningEffort}get supportsAdvancedExecutionControl(){return this.form.controls.supportsAdvancedExecution}get pricingGroup(){return this.form.controls.pricing}reasoningEffortOptions=Object.values(Ne);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=mT(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=mT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);selectedProviderLabel=mT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Ff(()=>{this.reasoningEffortUnsupported()?(this.reasoningEffortControl.setValue(null),this.reasoningEffortControl.disable()):this.reasoningEffortControl.enable();});}ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.reasoningEffortControl.setValue(e.reasoningEffort??null),this.supportsAdvancedExecutionControl.setValue(e.supportsAdvancedExecution??false),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,w$1=x(w({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,reasoningEffort:t.reasoningEffort??void 0,supportsAdvancedExecution:t.supportsAdvancedExecution,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",w$1):this.aiModelController.createAiModel(w$1)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=Nw({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[1,"ai-model-form__toggle-label"],["type","checkbox",1,"ai-model-form__toggle-checkbox",3,"formControl"],[1,"ai-model-form__toggle-text"],[1,"ai-model-form__toggle-hint"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return c.cancel()}),HC(3," \u2190 AI models "),ml()(),Yw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),ml()),e&2&&(QE(),pg("title",c.isEditMode()?"Edit AI model":"New AI model"),QE(3),Qw(c.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,Ea],encapsulation:2})};export{ge as AiModelFormComponent};
@@ -0,0 +1 @@
1
+ import {w as m,q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-CV72_wbg.js';import {g,F,K as we,$ as Sr,z as zi,a1 as ma,U as U$1,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,o as Il,s as sC,i as fg,q as mf,r as yf}from'./main-2W2EKPFF.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Is(0,"p",3),HC(1),ml()),t&2){let n=dC();QE(),Lg(n.deletion.error());}}function K(t,e){t&1&&(Is(0,"p",4),HC(1,"Loading prompts\u2026"),ml());}function H(t,e){t&1&&(Is(0,"p",5),HC(1,"No platform prompts defined yet."),ml());}function U(t,e){t&1&&(Is(0,"p",4),HC(1,"No prompts match the current filter."),ml());}function z(t,e){if(t&1){let n=sC();Is(0,"button",18),Eg("click",function(){mf(n);let m=dC().$implicit,p=dC(2);return yf(p.edit(m))}),HC(1,"Edit"),ml();}if(t&2){let n=dC().$implicit;fg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=sC();Is(0,"agentos-row-delete-action",19),Eg("deleteRequested",function(){mf(n);let m=dC().$implicit,p=dC(2);return yf(p.deletion.request(m.id))})("deleteConfirmed",function(){mf(n);let m=dC().$implicit,p=dC(2);return yf(p.confirmDelete(m))})("deleteCancelled",function(){mf(n);let m=dC(3);return yf(m.deletion.cancel())}),ml();}if(t&2){let n=dC().$implicit,r=dC(2);pg("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Is(0,"tr",9)(1,"td",12),HC(2),ml(),Is(3,"td",13),HC(4),ml(),Is(5,"td",14)(6,"div",15),Yw(7,z,2,1,"button",16),Yw(8,G,1,3,"agentos-row-delete-action",17),ml()()()),t&2){let n=e.$implicit,r=dC(2);QE(2),Lg(n.name),QE(2),Il(" ",n.description||"\u2014"," "),QE(3),Qw(r.deletion.confirmingId()!==n.id?7:-1),QE(),Qw(n.id?8:-1);}}function O(t,e){if(t&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"Description"),ml(),Is(8,"th",10)(9,"span",11),HC(10,"Actions"),ml()()()(),Is(11,"tbody",8),Jw(12,J,9,4,"tr",9,j),ml()()()),t&2){let n=dC();QE(12),eC(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);promptState=g(m);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();prompts=zi([]);rowFilter=O$1(this.prompts,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.promptState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.prompts.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","prompts","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","prompts",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.promptState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Nw({type:t,selectors:[["agentos-platform-prompts"]],decls:9,vars:3,consts:[["title","Platform prompts","description","Prompts shared across every namespace."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(p){return r.rowFilter.query.set(p)}),ml(),Is(2,"button",2),Eg("click",function(){return r.openCreateForm()}),HC(3,"New prompt"),ml()(),Yw(4,A,2,1,"p",3),Yw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(QE(),pg("query",r.rowFilter.query()),QE(3),Qw(r.deletion.error()?4:-1),QE(),Qw(r.isLoading()?5:r.prompts().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{B as PlatformPromptsComponent};
@@ -0,0 +1 @@
1
+ import {w as m,q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-CV72_wbg.js';import {g,W as W$1,F,K as we,$ as Sr,z as zi,a1 as ma,ac as Ny,a2 as ga,aa as _r,U as U$1,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,o as Il,s as sC,q as mf,r as yf,i as fg}from'./main-2W2EKPFF.js';var U=(n,e)=>e.key;function z(n,e){if(n&1&&(Is(0,"p",3),HC(1),ml()),n&2){let t=dC();QE(),Lg(t.deletion.error());}}function G(n,e){n&1&&(Is(0,"p",4),HC(1,"Loading prompts\u2026"),ml());}function O(n,e){n&1&&(Is(0,"p",5),HC(1,"No prompts available."),ml());}function Q(n,e){n&1&&(Is(0,"p",4),HC(1,"No prompts match the current filter."),ml());}function W(n,e){n&1&&(Is(0,"ds-tag",17),HC(1,"Read-only"),ml());}function X(n,e){if(n&1){let t=sC();Is(0,"button",23),Eg("click",function(){mf(t);let l=dC(2).$implicit,m=dC(2);return yf(m.edit(l))}),HC(1," Edit "),ml();}if(n&2){let t=dC(2).$implicit;fg("aria-label","Edit "+t.prompt.name);}}function Y(n,e){if(n&1){let t=sC();Yw(0,X,2,1,"button",21),Is(1,"agentos-row-delete-action",22),Eg("deleteRequested",function(){mf(t);let l=dC().$implicit,m=dC(2);return yf(m.deletion.request(l.key))})("deleteConfirmed",function(){mf(t);let l=dC().$implicit,m=dC(2);return yf(m.confirmDelete(l))})("deleteCancelled",function(){mf(t);let l=dC(3);return yf(l.deletion.cancel())}),ml();}if(n&2){let t=dC().$implicit,i=dC(2);Qw(i.deletion.confirmingId()!==t.key?0:-1),QE(),pg("rowKey",t.key)("rowLabel",t.prompt.name)("state",i.deletion);}}function Z(n,e){n&1&&(Is(0,"button",20),HC(1,"Inherited"),ml());}function ee(n,e){if(n&1&&(Is(0,"tr",9)(1,"td",12),HC(2),ml(),Is(3,"td",13),HC(4),ml(),Is(5,"td",14)(6,"div",15)(7,"ds-tag",16),HC(8),ml(),Yw(9,W,2,0,"ds-tag",17),ml()(),Is(10,"td",18)(11,"div",19),Yw(12,Y,2,4)(13,Z,2,0,"button",20),ml()()()),n&2){let t=e.$implicit;QE(2),Lg(t.prompt.name),QE(2),Il(" ",t.prompt.description||"\u2014"," "),QE(3),pg("variant",t.scope==="platform"?"neutral":"accent"),QE(),Lg(t.scope==="platform"?"Platform":"Namespace"),QE(),Qw(t.scope==="platform"?9:-1),QE(3),Qw(t.scope==="namespace"?12:13);}}function te(n,e){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"Description"),ml(),Is(8,"th",10),HC(9,"Scope"),ml(),Is(10,"th",10)(11,"span",11),HC(12,"Actions"),ml()()()(),Is(13,"tbody",8),Jw(14,ee,14,6,"tr",9,U),ml()()()),n&2){let t=dC();QE(14),eC(t.rowFilter.filteredRows());}}var J=class n{route=g(W$1);router=g(F);destroyRef=g(we);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();rows=zi([]);rowFilter=O$1(this.rows,e=>[e.prompt.name,e.prompt.description,e.scope].filter(Boolean).join(" "));allPrompts$=this.refresh$.pipe(ma(()=>(this.isLoading.set(true),Ny({platform:this.promptState.listPlatform().pipe(ga(()=>_r([]))),namespace:this.promptState.listByNamespace(this.namespaceId)}))));constructor(){this.allPrompts$.pipe(U$1(this.destroyRef)).subscribe({next:({platform:e,namespace:t})=>{this.rows.set([...e.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...t.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"prompts","new"]);}edit(e){e.scope==="platform"||!e.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"prompts",e.prompt.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.prompt.id||this.deletion.execute(e.key,{request$:this.promptState.delete(e.prompt.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.prompt.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Nw({type:n,selectors:[["agentos-namespace-prompts"]],decls:9,vars:3,consts:[["title","Prompts","description","Prompts available in this namespace, including prompts inherited from the platform."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(t,i){t&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return i.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),HC(3,"New prompt"),ml()(),Yw(4,z,2,1,"p",3),Yw(5,G,2,0,"p",4)(6,O,2,0,"p",5)(7,Q,2,0,"p",4)(8,te,16,0,"div",6)),t&2&&(QE(),pg("query",i.rowFilter.query()),QE(3),Qw(i.deletion.error()?4:-1),QE(),Qw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{J as NamespacePromptsComponent};
@@ -1,4 +1,4 @@
1
- import {aZ as A,a_ as z$1}from'./main-C2L5IBU7.js';var ut=z$1(Xe=>{"use strict";(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,a=/\\/g,s=/\u2028/,u=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(h,g){var S=h.length,U=0,R=1,q=2,E=U,$=null,ee=null,B="",I=[],J=!1,O=0,C=0,L="{{",b="}}";function te(){B.length>0&&(I.push({tag:"_t",text:new String(B)}),B="");}function ge(){for(var A=!0,k=C;k<I.length;k++)if(A=i.tags[I[k].tag]<i.tags._v||I[k].tag=="_t"&&I[k].text.match(n)===null,!A)return !1;return A}function be(A,k){if(te(),A&&ge())for(var _=C,ie;_<I.length;_++)I[_].text&&((ie=I[_+1])&&ie.tag==">"&&(ie.indent=I[_].text.toString()),I.splice(_,1));else k||I.push({tag:`
1
+ import {aZ as A,a_ as z$1}from'./main-2W2EKPFF.js';var ut=z$1(Xe=>{"use strict";(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,a=/\\/g,s=/\u2028/,u=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(h,g){var S=h.length,U=0,R=1,q=2,E=U,$=null,ee=null,B="",I=[],J=!1,O=0,C=0,L="{{",b="}}";function te(){B.length>0&&(I.push({tag:"_t",text:new String(B)}),B="");}function ge(){for(var A=!0,k=C;k<I.length;k++)if(A=i.tags[I[k].tag]<i.tags._v||I[k].tag=="_t"&&I[k].text.match(n)===null,!A)return !1;return A}function be(A,k){if(te(),A&&ge())for(var _=C,ie;_<I.length;_++)I[_].text&&((ie=I[_+1])&&ie.tag==">"&&(ie.indent=I[_].text.toString()),I.splice(_,1));else k||I.push({tag:`
2
2
  `});J=!1,C=I.length;}function ne(A,k){var _="="+b,ie=A.indexOf(_,k),De=f(A.substring(A.indexOf("=",k)+1,ie)).split(" ");return L=De[0],b=De[De.length-1],ie+_.length-1}for(g&&(g=g.split(" "),L=g[0],b=g[1]),O=0;O<S;O++)E==U?v(L,h,O)?(--O,te(),E=R):h.charAt(O)==`
3
3
  `?be(J):B+=h.charAt(O):E==R?(O+=L.length-1,ee=i.tags[h.charAt(O+1)],$=ee?h.charAt(O+1):"_v",$=="="?(O=ne(h,O),E=U):(ee&&O++,E=q),J=O):v(b,h,O)?(I.push({tag:$,n:f(B),otag:L,ctag:b,i:$=="/"?J-L.length:O+b.length}),B="",O+=b.length-1,E=U,$=="{"&&(b=="}}"?O++:d(I[I.length-1]))):B+=h.charAt(O);return be(J,!0),I};function d(l){l.n.substr(l.n.length-1)==="}"&&(l.n=l.n.substring(0,l.n.length-1));}function f(l){return l.trim?l.trim():l.replace(/^\s*|\s*$/g,"")}function v(l,h,g){if(h.charAt(g)!=l.charAt(0))return !1;for(var S=1,U=l.length;S<U;S++)if(h.charAt(g+S)!=l.charAt(S))return !1;return !0}var y={_t:!0,"\n":!0,$:!0,"/":!0};function o(l,h,g,S){var U=[],R=null,q=null,E=null;for(q=g[g.length-1];l.length>0;){if(E=l.shift(),q&&q.tag=="<"&&!(E.tag in y))throw new Error("Illegal content in < super tag.");if(i.tags[E.tag]<=i.tags.$||c(E,S))g.push(E),E.nodes=o(l,E.tag,g,S);else if(E.tag=="/"){if(g.length===0)throw new Error("Closing tag without opener: /"+E.n);if(R=g.pop(),E.n!=R.n&&!m(E.n,R.n,S))throw new Error("Nesting error: "+R.n+" vs. "+E.n);return R.end=E.i,U}else E.tag==`
4
4
  `&&(E.last=l.length==0||l[0].tag==`
@@ -1 +1 @@
1
- import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-BYsAPdst.js';import {O}from'./chunk-BxyolXEz.js';import {g,W,n as F$1,K as we,ag as U,ay as N,z as zi,az as Q,a8 as _,i as cT,a9 as F$2,aA as Me,L as U$1,a2 as ga,aa as br,ac as _y,ad as ne,P as x,N as w,I as Iw,au as $t,a as Is,R as vg,O as OC,b as gl,H as Hw,U as UE,Q as dg,c as Uw,s as rC,X as Xw,f as fg,S as AI,T as OI,l as lg,E as El,G as Gw,j as Ww,F as Fg,t as hf,u as gf,as as Pg}from'./main-C2L5IBU7.js';import {H as A,p as pt$1,T as Te,b as bn,I as E,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at$1,u as un,n as cn,A as Ao}from'./chunk-qF4-8qpt.js';import'./chunk-CMLKq_d1.js';var F="*";function Be(n){return (n??[]).some(t=>t.trim()===F)}function $e(n){let t=(n??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F).map(e=>e.toLowerCase());return new Set(t)}function j(n){return n.includes(F)}function He(n){let t=n.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(n,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F&&j(e)).some(e=>He(e)?.test(n)??false)}var Ge="AGENTOS_CONFIG",Je=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ue(n){return n.configEnabled&&(n.hasSubAgents||n.integrationTypes.some(t=>Je.has(t)))}var je=(n,t)=>t.value,Ye=(n,t)=>t.config.id,qe=(n,t)=>t.type,We=(n,t)=>t.selector;function ze(n,t){if(n&1&&(Is(0,"a",2),OC(1,"View resolved definition \u2192"),gl()),n&2){let e=rC();dg("routerLink",e.inspectRoute());}}function Xe(n,t){n&1&&(Is(0,"ds-tag",3),OC(1,"Platform level"),gl());}function Qe(n,t){n&1&&(Is(0,"p",4),OC(1,"Loading\u2026"),gl());}function Ze(n,t){if(n&1&&(fg(0,"input",17),AI()),n&2){let e=rC(2);dg("formControl",e.modelNameControl),OI();}}function et(n,t){if(n&1&&(Is(0,"option",41),OC(1),gl()),n&2){let e=t;dg("ngValue",e.value),UE(),Fg(e.label);}}function tt(n,t){if(n&1&&(Is(0,"option",41),OC(1),gl()),n&2){let e=t.$implicit;dg("ngValue",e.value),UE(),Fg(e.label);}}function nt(n,t){if(n&1&&(Is(0,"optgroup",42),Gw(1,tt,2,2,"option",41,je),gl()),n&2){let e=rC(3);UE(),Ww(e.modelOptions().aliases);}}function it(n,t){if(n&1&&(Is(0,"option",41),OC(1),gl()),n&2){let e=t.$implicit;dg("ngValue",e.value),UE(),Fg(e.label);}}function ot(n,t){if(n&1&&(Is(0,"optgroup",43),Gw(1,it,2,2,"option",41,je),gl()),n&2){let e=rC(3);UE(),Ww(e.modelOptions().apiNames);}}function at(n,t){if(n&1&&(Is(0,"select",18)(1,"option",40),OC(2,"Select a model"),gl(),Hw(3,et,2,2,"option",41),Hw(4,nt,3,0,"optgroup",42),Hw(5,ot,3,0,"optgroup",43),gl(),AI()),n&2){let e,i=rC(2);dg("formControl",i.modelNameControl),OI(),UE(),dg("ngValue",null),UE(2),Uw((e=i.modelOptions().current)?3:-1,e),UE(),Uw(i.modelOptions().aliases.length>0?4:-1),UE(),Uw(i.modelOptions().apiNames.length>0?5:-1);}}function lt(n,t){if(n&1&&(Is(0,"span",44),OC(1),gl()),n&2){let e=rC().$implicit;UE(),Fg(e.config.integrationType);}}function rt(n,t){if(n&1&&(fg(0,"input",45),AI()),n&2){let e=rC().$implicit;dg("formControl",e.toolsControl),lg("aria-label","Tools of "+e.config.name),OI();}}function st(n,t){if(n&1){let e=Xw();Is(0,"div",10)(1,"label",11)(2,"input",23),vg("change",function(){let s=hf(e).$implicit,c=rC(3);return gf(c.toggleIntegration(s))}),gl(),Is(3,"span",24),OC(4),gl(),Hw(5,lt,2,1,"span",44),gl(),Hw(6,rt,1,2,"input",45),gl();}if(n&2){let e=t.$implicit;UE(2),dg("checked",e.enabled()),UE(2),Fg(e.config.name),UE(),Uw(e.config.integrationType?5:-1),UE(),Uw(e.enabled()?6:-1);}}function dt(n,t){if(n&1&&(Is(0,"p",13),OC(1),gl()),n&2){let e=rC().$implicit;UE(),El(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ct(n,t){if(n&1){let e=Xw();Is(0,"div",10)(1,"label",24),OC(2),Is(3,"span",44),OC(4,"built-in"),gl()(),Is(5,"select",47),vg("change",function(s){let c=hf(e).$implicit,C=rC(4);return gf(C.setBuiltInState(c,s.target.value))}),Is(6,"option",48),OC(7),gl(),Is(8,"option",49),OC(9,"Enabled"),gl(),Is(10,"option",50),OC(11,"Disabled"),gl()(),Hw(12,dt,2,1,"p",13),Is(13,"p",13),OC(14),gl()();}if(n&2){let e=t.$implicit,i=rC(4);UE(),lg("for","built-in-"+e.type),UE(),El(" ",e.displayName," "),UE(3),dg("id","built-in-"+e.type)("value",e.state()),UE(2),Fg(i.builtInDefaultLabel(e)),UE(5),Uw(e.state()==="on"&&e.restrictedTools?12:-1),UE(2),Fg(e.description);}}function mt(n,t){if(n&1&&(Is(0,"span",46),OC(1,"Built-in integrations"),gl(),Gw(2,ct,15,7,"div",10,qe)),n&2){let e=rC(3);UE(2),Ww(e.builtInRows());}}function ut(n,t){n&1&&(Is(0,"ds-notice",26),OC(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),gl());}function gt(n,t){if(n&1&&(Is(0,"ds-fieldset",21),Gw(1,st,7,4,"div",10,Ye),Hw(3,mt,4,0),Hw(4,ut,2,0,"ds-notice",26),gl()),n&2){let e=rC(2);UE(),Ww(e.integrationRows()),UE(2),Uw(e.builtInRows().length>0?3:-1),UE(),Uw(e.configAgentExposureWarning()?4:-1);}}function pt(n,t){n&1&&OC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function ft(n,t){n&1&&(Is(0,"ds-notice",26),OC(1," Saving with this on replaces the selection below with "),Is(2,"code",25),OC(3,"*"),gl(),OC(4,". "),gl());}function Ct(n,t){n&1&&(Is(0,"ds-notice"),OC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),gl());}function _t(n,t){n&1&&(Is(0,"p",4),OC(1,"No skill available in this scope yet."),gl());}function bt(n,t){n&1&&(Is(0,"span",44),OC(1,"platform"),gl());}function ht(n,t){if(n&1&&(Is(0,"span",44),OC(1),gl()),n&2){let e=rC(4);UE(),El(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function yt(n,t){if(n&1&&(Is(0,"p",13),OC(1),gl()),n&2){let e=rC().$implicit;UE(),Fg(e.description);}}function vt(n,t){if(n&1){let e=Xw();Is(0,"div",10)(1,"label",11)(2,"input",51),vg("change",function(){let s=hf(e).$implicit,c=rC(3);return gf(c.toggleSkill(s))}),gl(),Is(3,"span",24),OC(4),gl(),Hw(5,bt,2,0,"span",44),Hw(6,ht,2,1,"span",44),gl(),Hw(7,yt,2,1,"p",13),gl();}if(n&2){let e=t.$implicit,i=rC(3);UE(2),dg("checked",e.selected())("disabled",i.allSkillsSelected()),UE(2),Fg(e.name),UE(),Uw(e.platform?5:-1),UE(),Uw(e.unresolved?6:-1),UE(),Uw(e.description?7:-1);}}function xt(n,t){if(n&1&&Gw(0,vt,8,6,"div",10,We),n&2){let e=rC(2);Ww(e.skillRows());}}function St(n,t){if(n&1&&(Is(0,"ds-form-field",30),fg(1,"textarea",52),AI(),Is(2,"p",4),OC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Is(4,"code"),OC(5,"AgentLoopPayload"),gl(),OC(6,". Leave empty if you always provide the payload at launch. "),gl()()),n&2){let e=rC(2);dg("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),UE(),dg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),OI();}}function At(n,t){n&1&&OC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function wt(n,t){if(n&1&&OC(0),n&2){let e=rC(3);Pg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Et(n,t){if(n&1&&(Is(0,"ds-notice",26),OC(1," Saving with this on replaces the selection below with "),Is(2,"code",25),OC(3,"*"),gl(),OC(4,". "),Hw(5,wt,1,2),gl()),n&2){let e=rC(2);UE(5),Uw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Tt(n,t){n&1&&(Is(0,"ds-notice"),OC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),gl());}function kt(n,t){n&1&&(Is(0,"p",4),OC(1,"No other agent is available in this scope yet."),gl());}function It(n,t){n&1&&(Is(0,"span",44),OC(1,"pattern"),gl());}function Rt(n,t){n&1&&(Is(0,"span",44),OC(1,"via pattern"),gl());}function Mt(n,t){if(n&1&&(Is(0,"span",44),OC(1),gl()),n&2){let e=rC(4);UE(),El(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ft(n,t){if(n&1){let e=Xw();Is(0,"button",55),vg("click",function(){hf(e);let s=rC().$implicit,c=rC(3);return gf(c.removeSubAgent(s))}),OC(1," \xD7 "),gl();}if(n&2){let e=rC().$implicit;lg("aria-label","Remove "+e.selector);}}function Nt(n,t){if(n&1){let e=Xw();Is(0,"div",32)(1,"label",53)(2,"input",51),vg("change",function(){let s=hf(e).$implicit,c=rC(3);return gf(c.toggleSubAgent(s))}),gl(),Is(3,"span",24),OC(4),gl(),Hw(5,It,2,0,"span",44)(6,Rt,2,0,"span",44)(7,Mt,2,1,"span",44),gl(),Hw(8,Ft,2,1,"button",54),gl();}if(n&2){let e=t.$implicit,i=rC(3);UE(2),dg("checked",e.selected())("disabled",i.allSubAgentsSelected()),UE(2),Fg(e.name),UE(),Uw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),UE(3),Uw(e.unresolved?8:-1);}}function Dt(n,t){if(n&1&&Gw(0,Nt,9,5,"div",32,We),n&2){let e=rC(2);Ww(e.subAgentRows());}}function Lt(n,t){if(n&1){let e=Xw();Is(0,"div")(1,"button",56),vg("click",function(){hf(e);let s=rC(2);return gf(s.useDefaultDelegationTimeout())}),OC(2," Use server default "),gl()();}}function Vt(n,t){n&1&&(Is(0,"ds-notice"),OC(1),gl()),n&2&&(UE(),Fg(t));}function Pt(n,t){if(n&1){let e=Xw();Is(0,"button",57),vg("click",function(){hf(e);let s=rC(2);return gf(s.exportYaml())}),OC(1),gl();}if(n&2){let e=rC(2);dg("disabled",e.isExporting()),UE(),El(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ot(n,t){if(n&1){let e=Xw();Is(0,"form",6),vg("ngSubmit",function(){hf(e);let s=rC();return gf(s.submit())}),Is(1,"ds-fieldset",7)(2,"ds-form-field",8),fg(3,"input",9),AI(),gl(),Is(4,"div",10)(5,"label",11),fg(6,"input",12),AI(),OC(7," Enabled "),gl(),Is(8,"p",13),OC(9,"Disabled agents are excluded from namespace resolution."),gl()(),Is(10,"ds-form-field",14),fg(11,"input",15),AI(),gl(),Is(12,"ds-form-field",16),Hw(13,Ze,1,1,"input",17)(14,at,6,5,"select",18),gl(),Is(15,"ds-form-field",19),fg(16,"textarea",20),AI(),gl()(),Hw(17,gt,5,2,"ds-fieldset",21),Is(18,"ds-fieldset",22)(19,"p",4),OC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Is(21,"code"),OC(22,"readSkill"),gl(),OC(23," and "),Is(24,"code"),OC(25,"readSkillResource"),gl(),OC(26," tools; selecting none grants neither. "),Hw(27,pt,1,0),gl(),Is(28,"label",11)(29,"input",23),vg("change",function(){hf(e);let s=rC();return gf(s.toggleAllSkills())}),gl(),Is(30,"span",24),OC(31,"Every skill in the catalogue ("),Is(32,"code",25),OC(33,"*"),gl(),OC(34,")"),gl()(),Is(35,"p",13),OC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),gl(),Hw(37,ft,5,0,"ds-notice",26),Hw(38,Ct,2,0,"ds-notice"),Hw(39,_t,2,0,"p",4)(40,xt,2,0),gl(),Is(41,"ds-form-field",27)(42,"select",28)(43,"option",29),OC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),gl(),Is(45,"option",29),OC(46,"ADVANCED \u2014 Multi-step reasoning loop"),gl(),Is(47,"option",29),OC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),gl()(),AI(),gl(),Hw(49,St,7,3,"ds-form-field",30),Is(50,"ds-fieldset",31)(51,"p",4),OC(52," The agents this one may delegate to. Selecting at least one grants it the "),Is(53,"code"),OC(54,"DELEGATE__delegate"),gl(),OC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Hw(56,At,1,0),gl(),Is(57,"label",11)(58,"input",23),vg("change",function(){hf(e);let s=rC();return gf(s.toggleAllSubAgents())}),gl(),Is(59,"span",24),OC(60,"Every agent it can reach ("),Is(61,"code",25),OC(62,"*"),gl(),OC(63,")"),gl()(),Is(64,"p",13),OC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),gl(),Hw(66,Et,6,1,"ds-notice",26),Hw(67,Tt,2,0,"ds-notice"),Hw(68,kt,2,0,"p",4)(69,Dt,2,0),Is(70,"p",4),OC(71," Advanced \u2014 add a glob instead of picking a name, for example "),Is(72,"code"),OC(73,"*Fixer"),gl(),OC(74," to cover BugFixer and StoryFixer. "),gl(),Is(75,"div",32)(76,"input",33),vg("keydown.enter",function(){hf(e);let s=rC();return gf(s.addSubAgent())}),gl(),AI(),Is(77,"button",34),vg("click",function(){hf(e);let s=rC();return gf(s.addSubAgent())}),OC(78," + "),gl()(),Is(79,"ds-form-field",35),fg(80,"input",36),AI(),Hw(81,Lt,3,0,"div"),gl()(),Hw(82,Vt,2,1,"ds-notice"),Is(83,"ds-form-actions")(84,"button",37),OC(85),gl(),Hw(86,Pt,2,2,"button",38),Is(87,"button",39),vg("click",function(){hf(e);let s=rC();return gf(s.cancel())}),OC(88,"Cancel"),gl()()();}if(n&2){let e,i=rC();dg("formGroup",i.form),UE(3),dg("formControl",i.nameControl),OI(),UE(3),dg("formControl",i.enabledControl),OI(),UE(5),dg("formControl",i.descriptionControl),OI(),UE(2),Uw(i.modelAsFreeText()?13:14),UE(3),dg("formControl",i.instructionsControl),OI(),UE(),Uw(i.integrationRows().length>0||i.builtInRows().length>0?17:-1),UE(10),Uw(i.isPlatformMode?27:-1),UE(2),dg("checked",i.allSkillsSelected()),UE(8),Uw(i.namedSkillSelectionDropped()?37:-1),UE(),Uw(i.skillCatalogueUnavailable()?38:-1),UE(),Uw(i.skillRows().length===0?39:40),UE(3),dg("formControl",i.executionModeControl),OI(),UE(),dg("value",i.ExecutionMode.SIMPLE),UE(2),dg("value",i.ExecutionMode.ADVANCED),UE(2),dg("value",i.ExecutionMode.LOOP),UE(2),Uw(i.isLoopMode()?49:-1),UE(7),Uw(i.isPlatformMode?56:-1),UE(2),dg("checked",i.allSubAgentsSelected()),UE(8),Uw(i.namedSubAgentSelectionDropped()?66:-1),UE(),Uw(i.subAgentCandidatesUnavailable()?67:-1),UE(),Uw(i.subAgentRows().length===0?68:69),UE(8),dg("formControl",i.newSubAgentControl),OI(),UE(),dg("disabled",!i.newSubAgentControl.value.trim()),UE(2),dg("hint",i.delegationTimeoutHint())("error",i.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),UE(),dg("formControl",i.delegationTimeoutControl),lg("aria-invalid",i.delegationTimeoutControl.invalid),OI(),UE(),Uw(i.delegationTimeoutControl.value!==null?81:-1),UE(),Uw((e=i.submitError())?82:-1,e),UE(2),dg("disabled",i.form.invalid||i.isSubmitting()),UE(),El(" ",i.isEditMode()?"Save changes":"Create"," "),UE(),Uw(i.isEditMode()?86:-1);}}var Ke=class n{route=g(W);router=g(F$1);destroyRef=g(we);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=zi(null);exportService=g(Q);integrationConfigState=g(O);integrationTypeController=g(_);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[bn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[bn.min(1),bn.max(2147483647),bn.pattern(/^\d+$/)]}),enabled:new Te(false,{nonNullable:true}),loopConfig:new Te(null,{validators:[n.jsonValidator]})});static notBlankValidator(t){let e=t.value;return typeof e=="string"&&e.length>0&&e.trim().length===0?{required:true}:null}static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(i){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}delegationTimeoutHint=cT(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$2(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=cT(()=>this.executionModeValue()==="LOOP");subAgentRows=zi([]);allSubAgentsSelected=zi(false);subAgentCandidatesUnavailable=zi(false);namedSubAgentSelectionDropped=cT(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=cT(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=cT(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);submitError=zi(null);ExecutionMode=Me;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=zi([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=cT(()=>Ue({configEnabled:this.builtInRows().some(t=>t.type===Ge&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=zi({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=zi(false);modelAsFreeText=cT(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(E(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=zi([]);skillRows=zi([]);allSkillsSelected=zi(false);skillCatalogueUnavailable=zi(false);namedSkillSelectionDropped=cT(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),ga(()=>br(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),_y({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:i,platformIntegrations:s,builtInTypes:c,skillCatalogue:C,delegationCandidates:E,models:T})=>{this.existingConfig=e,this.applyModelCatalogue(T,e.modelName??null),this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let f=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(f),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let N=[...s,...i];this.integrationRows.set(this.buildIntegrationRows(N,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,e.integrations??void 0)),this.allSubAgentsSelected.set(Be(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(E,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){_y({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:i,builtInTypes:s,skillCatalogue:c,delegationCandidates:C,models:E})=>{this.applyModelCatalogue(E,null);let T=[...i,...e];this.integrationRows.set(this.buildIntegrationRows(T,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(c,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(i=>({id:i.id??"",name:i.name,description:i.description,namespaceId:i.namespaceId??null,readOnly:i.readOnly===true}))))).pipe(ga(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),br([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),c=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),E=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:zi(c.has(f.name.toLowerCase()))})),T=new Set;for(let f of s){let N=l(f).toLowerCase();C.has(N)||T.has(N)||(T.add(N),E.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:zi(true)}));}return E}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){let t=this.agentConfigController.listPlatformAgentsAgentConfig(false).pipe(this.orNoCandidates()),e=this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,false).pipe(this.orNoCandidates()):br([]);return _y({platform:t,namespace:e}).pipe(ne(({platform:i,namespace:s})=>[...i,...s]),ne(i=>i.map(s=>s.name).filter(s=>s.length>0)),ne(i=>n.dedupeByKey(i)))}orNoCandidates(){return ga(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),br([])))}static dedupeByKey(t){let e=new Set;return t.filter(i=>{let s=i.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,i){let s=$e(e),c=i?.toLowerCase()??null,C=t.filter(_=>{let O=_.toLowerCase();return O!==c||s.has(O)}),E=new Set(C.map(_=>_.toLowerCase())),T=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:zi(s.has(_.toLowerCase()))})),f=new Set,N=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==F);for(let _ of N){let O=_.toLowerCase();E.has(O)||f.has(O)||(f.add(O),T.push({selector:_,name:_,unresolved:true,pattern:j(_),grantedByPattern:false,selected:zi(true)}));}return T}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),ga(t=>(console.error("[agent-config-form] failed to load integration types",t),br([]))))}buildIntegrationRows(t,e){return t.map(i=>{let s=i.name??"",c=e?.[s],C=e!=null&&s in e,E=Array.isArray(c)?c.join(", "):"";return {config:i,enabled:zi(C),toolsControl:new Te(E,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(i=>{let s=e!=null&&i.type in e,c=e?.[i.type],C=s?Array.isArray(c)&&c.length===0?"off":"on":"default";return {type:i.type,displayName:i.displayName,description:i.description,enabledByDefault:i.enabledByDefault===true,state:zi(C),restrictedTools:Array.isArray(c)&&c.length>0?c:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(i=>i.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===F?this.allSubAgentsSelected.set(true):this.subAgentRows.update(i=>this.withPatternGrants([...i,{selector:t,name:t,unresolved:true,pattern:j(t),grantedByPattern:false,selected:zi(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(i=>this.withPatternGrants(i.filter(s=>s.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>this.withPatternGrants(e));}withPatternGrants(t){let e=this.allSubAgentsSelected()?[]:t.filter(i=>i.selected()).map(i=>i.selector);return t.map(i=>i.unresolved?i:x(w({},i),{grantedByPattern:Y(i.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [F];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let i of this.integrationRows().filter(s=>s.enabled())){let s=i.config.name??"",c=i.toolsControl.value.trim();t[s]=c===""?null:c.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let i of this.builtInRows()){let s=i.state();s==="on"?t[i.type]=i.restrictedTools??null:s==="off"&&(t[i.type]=[]);}let e=new Set([...this.integrationRows().map(i=>i.config.name??""),...this.builtInRows().map(i=>i.type)]);for(let[i,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(i)||(t[i]=s);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:i=>{this.isSubmitting.set(false),this.submitError.set(n.serverMessage(i));}});}static serverMessage(t){let i=t?.error?.message;if(typeof i=="string"&&i.trim().length>0)return i;let s=t?.status;return s===0?"The server could not be reached. The agent was not saved.":typeof s=="number"&&s>=500?`The server failed to save the agent (HTTP ${s}). Nothing was changed.`:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let i=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(i),c=document.createElement("a");c.href=s,c.download=`${this.existingConfig?.name??"agent"}.yaml`,c.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Iw({type:n,selectors:[["agentos-agent-config-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Agent"],["label","Name","controlId","agent-config-name","required",""],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",3,"formControl"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","Description","controlId","agent-config-description"],["dsControl","","id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",3,"formControl"],["label","Model","controlId","agent-config-model-name","required","","hint","Aliases are matched first, then API model names. Resolved when the agent runs."],["dsControl","","id","agent-config-model-name","type","text","placeholder","Model alias or name to use, e.g. BIG","autocomplete","off",3,"formControl"],["dsControl","","id","agent-config-model-name",3,"formControl"],["label","Instructions","controlId","agent-config-instructions"],["dsControl","","id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",3,"formControl"],["legend","Integrations","hint","Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration."],["legend","Skills"],["type","checkbox",3,"change","checked"],[1,"ds-strong"],[1,"ds-code"],["tone","warning"],["label","Execution mode","controlId","agent-config-execution-mode","hint",'SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu.'],["dsControl","","id","agent-config-execution-mode",3,"formControl"],[3,"value"],["label","Loop configuration (JSON)","controlId","agent-config-loop-config",3,"error"],["legend","Sub-agents"],[1,"ds-inline"],["dsControl","","type","text","aria-label","New sub-agent pattern","placeholder","e.g. *Fixer","autocomplete","off",3,"keydown.enter","formControl"],["dsButton","","variant","icon","type","button","title","Add pattern","aria-label","Add pattern",3,"click","disabled"],["label","Delegation timeout (seconds)","controlId","delegation-timeout","hintId","delegation-timeout-hint","errorId","delegation-timeout-error",3,"hint","error"],["dsControl","","id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["disabled","",3,"ngValue"],[3,"ngValue"],["label","Aliases"],["label","API model names"],[1,"ds-meta"],["dsControl","","type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"ds-indent",3,"formControl"],[1,"ds-micro"],["dsControl","",1,"ds-indent","ds-control--auto",3,"change","id","value"],["value","default"],["value","on"],["value","off"],["type","checkbox",3,"change","checked","disabled"],["dsControl","","mono","","id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",3,"placeholder","formControl"],["dsCheck","",1,"ds-grow"],["dsButton","","variant","icon-danger","type","button","title","Remove"],["dsButton","","variant","icon-danger","type","button","title","Remove",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,i){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return i.cancel()}),OC(3," \u2190 Agent configs "),gl(),Hw(4,ze,2,1,"a",2),Hw(5,Xe,2,0,"ds-tag",3),gl(),Hw(6,Qe,2,0,"p",4)(7,Ot,89,33,"form",5),gl()),e&2&&(UE(),dg("title",i.isEditMode()?"Edit agent config":"New agent config"),UE(3),Uw(i.isEditMode()?4:-1),UE(),Uw(i.isPlatformMode?5:-1),UE(),Uw(i.isLoading()?6:7));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,$t,vn,yn,fn,pn,hn,_n,at$1,un,cn,Ao],encapsulation:2})};export{Ke as AgentConfigFormComponent};
1
+ import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-5mGW4E0G.js';import {O}from'./chunk-DtO-loh9.js';import {g,W,F as F$1,K as we,ag as U,ay as N,z as zi,az as Q,a8 as _,j as mT,a9 as F$2,aA as Me,U as U$1,a2 as ga,aa as _r,ac as Ny,ad as ne,O as x,M as w,N as Nw,au as $t,I as Is,R as Eg,H as HC,m as ml,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,s as sC,a as hg,S as BI,T as HI,i as fg,o as Il,J as Jw,k as eC,L as Lg,q as mf,r as yf,as as jg}from'./main-2W2EKPFF.js';import {H as A,p as pt$1,T as Te,b as bn,I as E,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at$1,u as un,n as cn,A as Ao}from'./chunk-CV72_wbg.js';import'./chunk-gOvITjLx.js';var F="*";function Be(n){return (n??[]).some(t=>t.trim()===F)}function $e(n){let t=(n??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F).map(e=>e.toLowerCase());return new Set(t)}function j(n){return n.includes(F)}function He(n){let t=n.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(n,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F&&j(e)).some(e=>He(e)?.test(n)??false)}var Ge="AGENTOS_CONFIG",Je=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ue(n){return n.configEnabled&&(n.hasSubAgents||n.integrationTypes.some(t=>Je.has(t)))}var je=(n,t)=>t.value,Ye=(n,t)=>t.config.id,qe=(n,t)=>t.type,We=(n,t)=>t.selector;function ze(n,t){if(n&1&&(Is(0,"a",2),HC(1,"View resolved definition \u2192"),ml()),n&2){let e=dC();pg("routerLink",e.inspectRoute());}}function Xe(n,t){n&1&&(Is(0,"ds-tag",3),HC(1,"Platform level"),ml());}function Qe(n,t){n&1&&(Is(0,"p",4),HC(1,"Loading\u2026"),ml());}function Ze(n,t){if(n&1&&(hg(0,"input",17),BI()),n&2){let e=dC(2);pg("formControl",e.modelNameControl),HI();}}function et(n,t){if(n&1&&(Is(0,"option",41),HC(1),ml()),n&2){let e=t;pg("ngValue",e.value),QE(),Lg(e.label);}}function tt(n,t){if(n&1&&(Is(0,"option",41),HC(1),ml()),n&2){let e=t.$implicit;pg("ngValue",e.value),QE(),Lg(e.label);}}function nt(n,t){if(n&1&&(Is(0,"optgroup",42),Jw(1,tt,2,2,"option",41,je),ml()),n&2){let e=dC(3);QE(),eC(e.modelOptions().aliases);}}function it(n,t){if(n&1&&(Is(0,"option",41),HC(1),ml()),n&2){let e=t.$implicit;pg("ngValue",e.value),QE(),Lg(e.label);}}function ot(n,t){if(n&1&&(Is(0,"optgroup",43),Jw(1,it,2,2,"option",41,je),ml()),n&2){let e=dC(3);QE(),eC(e.modelOptions().apiNames);}}function at(n,t){if(n&1&&(Is(0,"select",18)(1,"option",40),HC(2,"Select a model"),ml(),Yw(3,et,2,2,"option",41),Yw(4,nt,3,0,"optgroup",42),Yw(5,ot,3,0,"optgroup",43),ml(),BI()),n&2){let e,i=dC(2);pg("formControl",i.modelNameControl),HI(),QE(),pg("ngValue",null),QE(2),Qw((e=i.modelOptions().current)?3:-1,e),QE(),Qw(i.modelOptions().aliases.length>0?4:-1),QE(),Qw(i.modelOptions().apiNames.length>0?5:-1);}}function lt(n,t){if(n&1&&(Is(0,"span",44),HC(1),ml()),n&2){let e=dC().$implicit;QE(),Lg(e.config.integrationType);}}function rt(n,t){if(n&1&&(hg(0,"input",45),BI()),n&2){let e=dC().$implicit;pg("formControl",e.toolsControl),fg("aria-label","Tools of "+e.config.name),HI();}}function st(n,t){if(n&1){let e=sC();Is(0,"div",10)(1,"label",11)(2,"input",23),Eg("change",function(){let s=mf(e).$implicit,c=dC(3);return yf(c.toggleIntegration(s))}),ml(),Is(3,"span",24),HC(4),ml(),Yw(5,lt,2,1,"span",44),ml(),Yw(6,rt,1,2,"input",45),ml();}if(n&2){let e=t.$implicit;QE(2),pg("checked",e.enabled()),QE(2),Lg(e.config.name),QE(),Qw(e.config.integrationType?5:-1),QE(),Qw(e.enabled()?6:-1);}}function dt(n,t){if(n&1&&(Is(0,"p",13),HC(1),ml()),n&2){let e=dC().$implicit;QE(),Il(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ct(n,t){if(n&1){let e=sC();Is(0,"div",10)(1,"label",24),HC(2),Is(3,"span",44),HC(4,"built-in"),ml()(),Is(5,"select",47),Eg("change",function(s){let c=mf(e).$implicit,C=dC(4);return yf(C.setBuiltInState(c,s.target.value))}),Is(6,"option",48),HC(7),ml(),Is(8,"option",49),HC(9,"Enabled"),ml(),Is(10,"option",50),HC(11,"Disabled"),ml()(),Yw(12,dt,2,1,"p",13),Is(13,"p",13),HC(14),ml()();}if(n&2){let e=t.$implicit,i=dC(4);QE(),fg("for","built-in-"+e.type),QE(),Il(" ",e.displayName," "),QE(3),pg("id","built-in-"+e.type)("value",e.state()),QE(2),Lg(i.builtInDefaultLabel(e)),QE(5),Qw(e.state()==="on"&&e.restrictedTools?12:-1),QE(2),Lg(e.description);}}function mt(n,t){if(n&1&&(Is(0,"span",46),HC(1,"Built-in integrations"),ml(),Jw(2,ct,15,7,"div",10,qe)),n&2){let e=dC(3);QE(2),eC(e.builtInRows());}}function ut(n,t){n&1&&(Is(0,"ds-notice",26),HC(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),ml());}function gt(n,t){if(n&1&&(Is(0,"ds-fieldset",21),Jw(1,st,7,4,"div",10,Ye),Yw(3,mt,4,0),Yw(4,ut,2,0,"ds-notice",26),ml()),n&2){let e=dC(2);QE(),eC(e.integrationRows()),QE(2),Qw(e.builtInRows().length>0?3:-1),QE(),Qw(e.configAgentExposureWarning()?4:-1);}}function pt(n,t){n&1&&HC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function ft(n,t){n&1&&(Is(0,"ds-notice",26),HC(1," Saving with this on replaces the selection below with "),Is(2,"code",25),HC(3,"*"),ml(),HC(4,". "),ml());}function Ct(n,t){n&1&&(Is(0,"ds-notice"),HC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function _t(n,t){n&1&&(Is(0,"p",4),HC(1,"No skill available in this scope yet."),ml());}function bt(n,t){n&1&&(Is(0,"span",44),HC(1,"platform"),ml());}function ht(n,t){if(n&1&&(Is(0,"span",44),HC(1),ml()),n&2){let e=dC(4);QE(),Il(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function yt(n,t){if(n&1&&(Is(0,"p",13),HC(1),ml()),n&2){let e=dC().$implicit;QE(),Lg(e.description);}}function vt(n,t){if(n&1){let e=sC();Is(0,"div",10)(1,"label",11)(2,"input",51),Eg("change",function(){let s=mf(e).$implicit,c=dC(3);return yf(c.toggleSkill(s))}),ml(),Is(3,"span",24),HC(4),ml(),Yw(5,bt,2,0,"span",44),Yw(6,ht,2,1,"span",44),ml(),Yw(7,yt,2,1,"p",13),ml();}if(n&2){let e=t.$implicit,i=dC(3);QE(2),pg("checked",e.selected())("disabled",i.allSkillsSelected()),QE(2),Lg(e.name),QE(),Qw(e.platform?5:-1),QE(),Qw(e.unresolved?6:-1),QE(),Qw(e.description?7:-1);}}function xt(n,t){if(n&1&&Jw(0,vt,8,6,"div",10,We),n&2){let e=dC(2);eC(e.skillRows());}}function St(n,t){if(n&1&&(Is(0,"ds-form-field",30),hg(1,"textarea",52),BI(),Is(2,"p",4),HC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Is(4,"code"),HC(5,"AgentLoopPayload"),ml(),HC(6,". Leave empty if you always provide the payload at launch. "),ml()()),n&2){let e=dC(2);pg("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),QE(),pg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),HI();}}function At(n,t){n&1&&HC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function wt(n,t){if(n&1&&HC(0),n&2){let e=dC(3);jg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Et(n,t){if(n&1&&(Is(0,"ds-notice",26),HC(1," Saving with this on replaces the selection below with "),Is(2,"code",25),HC(3,"*"),ml(),HC(4,". "),Yw(5,wt,1,2),ml()),n&2){let e=dC(2);QE(5),Qw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Tt(n,t){n&1&&(Is(0,"ds-notice"),HC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function kt(n,t){n&1&&(Is(0,"p",4),HC(1,"No other agent is available in this scope yet."),ml());}function It(n,t){n&1&&(Is(0,"span",44),HC(1,"pattern"),ml());}function Rt(n,t){n&1&&(Is(0,"span",44),HC(1,"via pattern"),ml());}function Mt(n,t){if(n&1&&(Is(0,"span",44),HC(1),ml()),n&2){let e=dC(4);QE(),Il(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ft(n,t){if(n&1){let e=sC();Is(0,"button",55),Eg("click",function(){mf(e);let s=dC().$implicit,c=dC(3);return yf(c.removeSubAgent(s))}),HC(1," \xD7 "),ml();}if(n&2){let e=dC().$implicit;fg("aria-label","Remove "+e.selector);}}function Nt(n,t){if(n&1){let e=sC();Is(0,"div",32)(1,"label",53)(2,"input",51),Eg("change",function(){let s=mf(e).$implicit,c=dC(3);return yf(c.toggleSubAgent(s))}),ml(),Is(3,"span",24),HC(4),ml(),Yw(5,It,2,0,"span",44)(6,Rt,2,0,"span",44)(7,Mt,2,1,"span",44),ml(),Yw(8,Ft,2,1,"button",54),ml();}if(n&2){let e=t.$implicit,i=dC(3);QE(2),pg("checked",e.selected())("disabled",i.allSubAgentsSelected()),QE(2),Lg(e.name),QE(),Qw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),QE(3),Qw(e.unresolved?8:-1);}}function Dt(n,t){if(n&1&&Jw(0,Nt,9,5,"div",32,We),n&2){let e=dC(2);eC(e.subAgentRows());}}function Lt(n,t){if(n&1){let e=sC();Is(0,"div")(1,"button",56),Eg("click",function(){mf(e);let s=dC(2);return yf(s.useDefaultDelegationTimeout())}),HC(2," Use server default "),ml()();}}function Vt(n,t){n&1&&(Is(0,"ds-notice"),HC(1),ml()),n&2&&(QE(),Lg(t));}function Pt(n,t){if(n&1){let e=sC();Is(0,"button",57),Eg("click",function(){mf(e);let s=dC(2);return yf(s.exportYaml())}),HC(1),ml();}if(n&2){let e=dC(2);pg("disabled",e.isExporting()),QE(),Il(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ot(n,t){if(n&1){let e=sC();Is(0,"form",6),Eg("ngSubmit",function(){mf(e);let s=dC();return yf(s.submit())}),Is(1,"ds-fieldset",7)(2,"ds-form-field",8),hg(3,"input",9),BI(),ml(),Is(4,"div",10)(5,"label",11),hg(6,"input",12),BI(),HC(7," Enabled "),ml(),Is(8,"p",13),HC(9,"Disabled agents are excluded from namespace resolution."),ml()(),Is(10,"ds-form-field",14),hg(11,"input",15),BI(),ml(),Is(12,"ds-form-field",16),Yw(13,Ze,1,1,"input",17)(14,at,6,5,"select",18),ml(),Is(15,"ds-form-field",19),hg(16,"textarea",20),BI(),ml()(),Yw(17,gt,5,2,"ds-fieldset",21),Is(18,"ds-fieldset",22)(19,"p",4),HC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Is(21,"code"),HC(22,"readSkill"),ml(),HC(23," and "),Is(24,"code"),HC(25,"readSkillResource"),ml(),HC(26," tools; selecting none grants neither. "),Yw(27,pt,1,0),ml(),Is(28,"label",11)(29,"input",23),Eg("change",function(){mf(e);let s=dC();return yf(s.toggleAllSkills())}),ml(),Is(30,"span",24),HC(31,"Every skill in the catalogue ("),Is(32,"code",25),HC(33,"*"),ml(),HC(34,")"),ml()(),Is(35,"p",13),HC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),ml(),Yw(37,ft,5,0,"ds-notice",26),Yw(38,Ct,2,0,"ds-notice"),Yw(39,_t,2,0,"p",4)(40,xt,2,0),ml(),Is(41,"ds-form-field",27)(42,"select",28)(43,"option",29),HC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),ml(),Is(45,"option",29),HC(46,"ADVANCED \u2014 Multi-step reasoning loop"),ml(),Is(47,"option",29),HC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),ml()(),BI(),ml(),Yw(49,St,7,3,"ds-form-field",30),Is(50,"ds-fieldset",31)(51,"p",4),HC(52," The agents this one may delegate to. Selecting at least one grants it the "),Is(53,"code"),HC(54,"DELEGATE__delegate"),ml(),HC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Yw(56,At,1,0),ml(),Is(57,"label",11)(58,"input",23),Eg("change",function(){mf(e);let s=dC();return yf(s.toggleAllSubAgents())}),ml(),Is(59,"span",24),HC(60,"Every agent it can reach ("),Is(61,"code",25),HC(62,"*"),ml(),HC(63,")"),ml()(),Is(64,"p",13),HC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),ml(),Yw(66,Et,6,1,"ds-notice",26),Yw(67,Tt,2,0,"ds-notice"),Yw(68,kt,2,0,"p",4)(69,Dt,2,0),Is(70,"p",4),HC(71," Advanced \u2014 add a glob instead of picking a name, for example "),Is(72,"code"),HC(73,"*Fixer"),ml(),HC(74," to cover BugFixer and StoryFixer. "),ml(),Is(75,"div",32)(76,"input",33),Eg("keydown.enter",function(){mf(e);let s=dC();return yf(s.addSubAgent())}),ml(),BI(),Is(77,"button",34),Eg("click",function(){mf(e);let s=dC();return yf(s.addSubAgent())}),HC(78," + "),ml()(),Is(79,"ds-form-field",35),hg(80,"input",36),BI(),Yw(81,Lt,3,0,"div"),ml()(),Yw(82,Vt,2,1,"ds-notice"),Is(83,"ds-form-actions")(84,"button",37),HC(85),ml(),Yw(86,Pt,2,2,"button",38),Is(87,"button",39),Eg("click",function(){mf(e);let s=dC();return yf(s.cancel())}),HC(88,"Cancel"),ml()()();}if(n&2){let e,i=dC();pg("formGroup",i.form),QE(3),pg("formControl",i.nameControl),HI(),QE(3),pg("formControl",i.enabledControl),HI(),QE(5),pg("formControl",i.descriptionControl),HI(),QE(2),Qw(i.modelAsFreeText()?13:14),QE(3),pg("formControl",i.instructionsControl),HI(),QE(),Qw(i.integrationRows().length>0||i.builtInRows().length>0?17:-1),QE(10),Qw(i.isPlatformMode?27:-1),QE(2),pg("checked",i.allSkillsSelected()),QE(8),Qw(i.namedSkillSelectionDropped()?37:-1),QE(),Qw(i.skillCatalogueUnavailable()?38:-1),QE(),Qw(i.skillRows().length===0?39:40),QE(3),pg("formControl",i.executionModeControl),HI(),QE(),pg("value",i.ExecutionMode.SIMPLE),QE(2),pg("value",i.ExecutionMode.ADVANCED),QE(2),pg("value",i.ExecutionMode.LOOP),QE(2),Qw(i.isLoopMode()?49:-1),QE(7),Qw(i.isPlatformMode?56:-1),QE(2),pg("checked",i.allSubAgentsSelected()),QE(8),Qw(i.namedSubAgentSelectionDropped()?66:-1),QE(),Qw(i.subAgentCandidatesUnavailable()?67:-1),QE(),Qw(i.subAgentRows().length===0?68:69),QE(8),pg("formControl",i.newSubAgentControl),HI(),QE(),pg("disabled",!i.newSubAgentControl.value.trim()),QE(2),pg("hint",i.delegationTimeoutHint())("error",i.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),QE(),pg("formControl",i.delegationTimeoutControl),fg("aria-invalid",i.delegationTimeoutControl.invalid),HI(),QE(),Qw(i.delegationTimeoutControl.value!==null?81:-1),QE(),Qw((e=i.submitError())?82:-1,e),QE(2),pg("disabled",i.form.invalid||i.isSubmitting()),QE(),Il(" ",i.isEditMode()?"Save changes":"Create"," "),QE(),Qw(i.isEditMode()?86:-1);}}var Ke=class n{route=g(W);router=g(F$1);destroyRef=g(we);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=zi(null);exportService=g(Q);integrationConfigState=g(O);integrationTypeController=g(_);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[bn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[bn.min(1),bn.max(2147483647),bn.pattern(/^\d+$/)]}),enabled:new Te(false,{nonNullable:true}),loopConfig:new Te(null,{validators:[n.jsonValidator]})});static notBlankValidator(t){let e=t.value;return typeof e=="string"&&e.length>0&&e.trim().length===0?{required:true}:null}static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(i){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}delegationTimeoutHint=mT(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$2(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=mT(()=>this.executionModeValue()==="LOOP");subAgentRows=zi([]);allSubAgentsSelected=zi(false);subAgentCandidatesUnavailable=zi(false);namedSubAgentSelectionDropped=mT(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=mT(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=mT(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);submitError=zi(null);ExecutionMode=Me;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=zi([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=mT(()=>Ue({configEnabled:this.builtInRows().some(t=>t.type===Ge&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=zi({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=zi(false);modelAsFreeText=mT(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(E(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=zi([]);skillRows=zi([]);allSkillsSelected=zi(false);skillCatalogueUnavailable=zi(false);namedSkillSelectionDropped=mT(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),ga(()=>_r(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),Ny({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:i,platformIntegrations:s,builtInTypes:c,skillCatalogue:C,delegationCandidates:E,models:T})=>{this.existingConfig=e,this.applyModelCatalogue(T,e.modelName??null),this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let f=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(f),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let N=[...s,...i];this.integrationRows.set(this.buildIntegrationRows(N,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,e.integrations??void 0)),this.allSubAgentsSelected.set(Be(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(E,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){Ny({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:i,builtInTypes:s,skillCatalogue:c,delegationCandidates:C,models:E})=>{this.applyModelCatalogue(E,null);let T=[...i,...e];this.integrationRows.set(this.buildIntegrationRows(T,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(c,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(i=>({id:i.id??"",name:i.name,description:i.description,namespaceId:i.namespaceId??null,readOnly:i.readOnly===true}))))).pipe(ga(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),_r([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),c=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),E=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:zi(c.has(f.name.toLowerCase()))})),T=new Set;for(let f of s){let N=l(f).toLowerCase();C.has(N)||T.has(N)||(T.add(N),E.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:zi(true)}));}return E}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){let t=this.agentConfigController.listPlatformAgentsAgentConfig(false).pipe(this.orNoCandidates()),e=this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,false).pipe(this.orNoCandidates()):_r([]);return Ny({platform:t,namespace:e}).pipe(ne(({platform:i,namespace:s})=>[...i,...s]),ne(i=>i.map(s=>s.name).filter(s=>s.length>0)),ne(i=>n.dedupeByKey(i)))}orNoCandidates(){return ga(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),_r([])))}static dedupeByKey(t){let e=new Set;return t.filter(i=>{let s=i.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,i){let s=$e(e),c=i?.toLowerCase()??null,C=t.filter(_=>{let O=_.toLowerCase();return O!==c||s.has(O)}),E=new Set(C.map(_=>_.toLowerCase())),T=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:zi(s.has(_.toLowerCase()))})),f=new Set,N=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==F);for(let _ of N){let O=_.toLowerCase();E.has(O)||f.has(O)||(f.add(O),T.push({selector:_,name:_,unresolved:true,pattern:j(_),grantedByPattern:false,selected:zi(true)}));}return T}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),ga(t=>(console.error("[agent-config-form] failed to load integration types",t),_r([]))))}buildIntegrationRows(t,e){return t.map(i=>{let s=i.name??"",c=e?.[s],C=e!=null&&s in e,E=Array.isArray(c)?c.join(", "):"";return {config:i,enabled:zi(C),toolsControl:new Te(E,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(i=>{let s=e!=null&&i.type in e,c=e?.[i.type],C=s?Array.isArray(c)&&c.length===0?"off":"on":"default";return {type:i.type,displayName:i.displayName,description:i.description,enabledByDefault:i.enabledByDefault===true,state:zi(C),restrictedTools:Array.isArray(c)&&c.length>0?c:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(i=>i.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===F?this.allSubAgentsSelected.set(true):this.subAgentRows.update(i=>this.withPatternGrants([...i,{selector:t,name:t,unresolved:true,pattern:j(t),grantedByPattern:false,selected:zi(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(i=>this.withPatternGrants(i.filter(s=>s.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>this.withPatternGrants(e));}withPatternGrants(t){let e=this.allSubAgentsSelected()?[]:t.filter(i=>i.selected()).map(i=>i.selector);return t.map(i=>i.unresolved?i:x(w({},i),{grantedByPattern:Y(i.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [F];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let i of this.integrationRows().filter(s=>s.enabled())){let s=i.config.name??"",c=i.toolsControl.value.trim();t[s]=c===""?null:c.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let i of this.builtInRows()){let s=i.state();s==="on"?t[i.type]=i.restrictedTools??null:s==="off"&&(t[i.type]=[]);}let e=new Set([...this.integrationRows().map(i=>i.config.name??""),...this.builtInRows().map(i=>i.type)]);for(let[i,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(i)||(t[i]=s);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:i=>{this.isSubmitting.set(false),this.submitError.set(n.serverMessage(i));}});}static serverMessage(t){let i=t?.error?.message;if(typeof i=="string"&&i.trim().length>0)return i;let s=t?.status;return s===0?"The server could not be reached. The agent was not saved.":typeof s=="number"&&s>=500?`The server failed to save the agent (HTTP ${s}). Nothing was changed.`:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let i=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(i),c=document.createElement("a");c.href=s,c.download=`${this.existingConfig?.name??"agent"}.yaml`,c.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Nw({type:n,selectors:[["agentos-agent-config-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Agent"],["label","Name","controlId","agent-config-name","required",""],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",3,"formControl"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","Description","controlId","agent-config-description"],["dsControl","","id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",3,"formControl"],["label","Model","controlId","agent-config-model-name","required","","hint","Aliases are matched first, then API model names. Resolved when the agent runs."],["dsControl","","id","agent-config-model-name","type","text","placeholder","Model alias or name to use, e.g. BIG","autocomplete","off",3,"formControl"],["dsControl","","id","agent-config-model-name",3,"formControl"],["label","Instructions","controlId","agent-config-instructions"],["dsControl","","id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",3,"formControl"],["legend","Integrations","hint","Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration."],["legend","Skills"],["type","checkbox",3,"change","checked"],[1,"ds-strong"],[1,"ds-code"],["tone","warning"],["label","Execution mode","controlId","agent-config-execution-mode","hint",'SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu.'],["dsControl","","id","agent-config-execution-mode",3,"formControl"],[3,"value"],["label","Loop configuration (JSON)","controlId","agent-config-loop-config",3,"error"],["legend","Sub-agents"],[1,"ds-inline"],["dsControl","","type","text","aria-label","New sub-agent pattern","placeholder","e.g. *Fixer","autocomplete","off",3,"keydown.enter","formControl"],["dsButton","","variant","icon","type","button","title","Add pattern","aria-label","Add pattern",3,"click","disabled"],["label","Delegation timeout (seconds)","controlId","delegation-timeout","hintId","delegation-timeout-hint","errorId","delegation-timeout-error",3,"hint","error"],["dsControl","","id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["disabled","",3,"ngValue"],[3,"ngValue"],["label","Aliases"],["label","API model names"],[1,"ds-meta"],["dsControl","","type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"ds-indent",3,"formControl"],[1,"ds-micro"],["dsControl","",1,"ds-indent","ds-control--auto",3,"change","id","value"],["value","default"],["value","on"],["value","off"],["type","checkbox",3,"change","checked","disabled"],["dsControl","","mono","","id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",3,"placeholder","formControl"],["dsCheck","",1,"ds-grow"],["dsButton","","variant","icon-danger","type","button","title","Remove"],["dsButton","","variant","icon-danger","type","button","title","Remove",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,i){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return i.cancel()}),HC(3," \u2190 Agent configs "),ml(),Yw(4,ze,2,1,"a",2),Yw(5,Xe,2,0,"ds-tag",3),ml(),Yw(6,Qe,2,0,"p",4)(7,Ot,89,33,"form",5),ml()),e&2&&(QE(),pg("title",i.isEditMode()?"Edit agent config":"New agent config"),QE(3),Qw(i.isEditMode()?4:-1),QE(),Qw(i.isPlatformMode?5:-1),QE(),Qw(i.isLoading()?6:7));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,$t,vn,yn,fn,pn,hn,_n,at$1,un,cn,Ao],encapsulation:2})};export{Ke as AgentConfigFormComponent};
@@ -0,0 +1 @@
1
+ import {f,y,p as pt,T as Te,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,Q as Qt,c as fo,g as go,t as ta,N as Nn,R as Rn,v as vn,d as yn,e as fn,h as hn,i as at,u as un}from'./chunk-CV72_wbg.js';import {g,W,F,G as J,K as we,j as mT,z as zi,n as Ff,U,M as w,O as x,N as Nw,I as Is,a as hg,Y as Yw,m as ml,P as pg,Q as QE,b as Qw,H as HC,s as sC,R as Eg,S as BI,J as Jw,p as dC,T as HI,i as fg,k as eC,o as Il,L as Lg,q as mf,r as yf}from'./main-2W2EKPFF.js';var de=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function me(i){return de.test(i)}function ie(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||me(e)?null:{absolutePath:true}}}var ce=(i,t)=>t.value;function ue(i,t){i&1&&(Is(0,"p",2),HC(1,"Loading\u2026"),ml());}function he(i,t){if(i&1&&(Is(0,"option",23),HC(1),ml()),i&2){let e=t.$implicit;pg("value",e.value),QE(),Lg(e.label);}}function pe(i,t){if(i&1){let e=sC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let p=dC();return yf(p.submit())}),Is(1,"ds-form-field",5),hg(2,"input",6),BI(),ml(),Is(3,"ds-form-field",7),hg(4,"textarea",8),BI(),ml(),Is(5,"ds-form-field",9),hg(6,"input",10),BI(),ml(),Is(7,"ds-form-field",11),hg(8,"input",12),BI(),ml(),Is(9,"ds-form-field",13),hg(10,"input",14),BI(),ml(),Is(11,"ds-form-field",15),hg(12,"input",16),BI(),ml(),Is(13,"ds-form-field",17),hg(14,"input",18),BI(),ml(),Is(15,"ds-form-field",19)(16,"input",20),Eg("input",function(p){mf(e);let se=dC();return yf(se.onMaxToolRoundsInput(p))}),ml(),BI(),ml(),Is(17,"ds-form-field",21)(18,"select",22),Jw(19,he,2,2,"option",23,ce),ml(),BI(),ml(),Is(21,"ds-form-actions")(22,"button",24),HC(23),ml(),Is(24,"button",25),Eg("click",function(){mf(e);let p=dC();return yf(p.cancel())}),HC(25,"Cancel"),ml()()();}if(i&2){let e=dC();pg("formGroup",e.form),QE(2),pg("formControl",e.nameControl),HI(),QE(2),pg("formControl",e.descriptionControl),HI(),QE(2),pg("formControl",e.externalIdControl),HI(),QE(2),pg("formControl",e.defaultAgentNameControl),HI(),QE(2),pg("formControl",e.configPathControl),HI(),QE(),pg("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),QE(),pg("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),fg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),HI(),QE(),pg("hint",e.runCostThresholdHint()),QE(),pg("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),HI(),QE(),pg("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),QE(),pg("formControl",e.maxToolRoundsControl),fg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),HI(),QE(2),pg("formControl",e.adminCaseListingControl),HI(),QE(),eC(e.adminCaseListingOptions),QE(3),pg("disabled",e.form.invalid||e.isSubmitting()),QE(),Il(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=1,ge=2147483647,Ce=[{value:"",label:"Default"},{value:"OWN",label:"Their own cases"},{value:"SWITCH",label:"Their own, with a switch to see all"},{value:"ALL",label:"All cases of the namespace"}],le=class i{route=g(W);router=g(F);namespaceController=g(J);destroyRef=g(we);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=mT(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=mT(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=mT(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=mT(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ie(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[bn.min(fe),bn.max(ge),bn.pattern(/^\d+$/)]}),adminCaseListing:new Te("",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}get adminCaseListingControl(){return this.form.controls.adminCaseListing}adminCaseListingOptions=Ce;maxToolRoundsUnparsable=zi(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);existingNamespace=null;constructor(){Ff(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.adminCaseListingControl.setValue(e.adminCaseListing??""),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0,adminCaseListing:this.adminCaseListingControl.value||void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Nw({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["label","Cases visible to admins","controlId","ns-admin-case-listing","hintId","ns-admin-case-listing-hint","hint","Choose which conversations the admins of this namespace see in their list. Members always see only their own."],["dsControl","","id","ns-admin-case-listing","aria-describedby","ns-admin-case-listing-hint",3,"formControl"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Is(0,"ds-page",0),hg(1,"ds-section-header",1),Yw(2,ue,2,0,"p",2)(3,pe,26,20,"form",3),ml()),e&2&&(pg("framed",!u.isEditMode()),QE(),pg("title",u.isEditMode()?"Edit namespace":"New namespace"),QE(),Qw(u.isLoading()?2:3));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Qt,fo,go,ta,Nn,Rn,vn,yn,fn,hn,at,un],encapsulation:2})};export{Ce as ADMIN_CASE_LISTING_OPTIONS,le as NamespaceFormComponent};
@@ -0,0 +1 @@
1
+ import {n}from'./chunk-CfgXrte_.js';import {q as k,O,a5 as w,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-CV72_wbg.js';import {I}from'./chunk-DEd4dYEy.js';import {v}from'./chunk-C-TFPDAn.js';import {g,W,F,K as we,z as zi,U,ad as ne$1,a1 as ma,aa as _r,aM as di,a2 as ga,ac as Ny,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,w as xC,i as fg,o as Il,J as Jw,k as eC,s as sC,q as mf,r as yf}from'./main-2W2EKPFF.js';import'./chunk-gOvITjLx.js';var Q=(i,t)=>t.key;function X(i,t){if(i&1&&(Is(0,"p",3),HC(1),ml()),i&2){let e=dC();QE(),Lg(e.deletion.error());}}function Z(i,t){if(i&1&&(Is(0,"p"),HC(1),ml()),i&2){let e=t;xC(e.kind==="error"?"settings-table__error":"settings-table__status"),fg("role",e.kind==="error"?"alert":"status"),QE(),Il(" ",e.text," ");}}function ee(i,t){i&1&&(Is(0,"p",5),HC(1,"Loading auth settings\u2026"),ml());}function te(i,t){i&1&&(Is(0,"p",6),HC(1,"No auth settings available."),ml());}function ne(i,t){i&1&&(Is(0,"p",5),HC(1,"No auth settings match the current filter."),ml());}function ie(i,t){i&1&&(Is(0,"ds-tag",18),HC(1,"Read-only"),ml());}function oe(i,t){i&1&&(Is(0,"ds-tag",20),HC(1,"Connected"),ml());}function ae(i,t){i&1&&(Is(0,"ds-tag",18),HC(1,"Not connected"),ml());}function se(i,t){i&1&&(Is(0,"span",21),HC(1,"\u2014"),ml());}function re(i,t){if(i&1){let e=sC();Is(0,"span",26),HC(1,"Waiting for authorization\u2026"),ml(),Is(2,"button",27),Eg("click",function(){mf(e);let r=dC(4);return yf(r.cancelConnect())}),HC(3," Cancel "),ml();}if(i&2){let e=dC(2).$implicit;QE(2),fg("aria-label","Stop waiting for the authorization of "+e.config.name);}}function le(i,t){if(i&1){let e=sC();Is(0,"span",28),HC(1,"Disconnect?"),ml(),Is(2,"button",29),Eg("click",function(){mf(e);let r=dC(2).$implicit,d=dC(2);return yf(d.confirmReset(r))}),HC(3),ml(),Is(4,"button",29),Eg("click",function(){mf(e);let r=dC(4);return yf(r.cancelReset())}),HC(5," Cancel "),ml();}if(i&2){let e=dC(2).$implicit,n=dC(2);QE(2),pg("disabled",n.resettingKey()===e.key),fg("aria-label","Confirm disconnecting "+e.config.name),QE(),Il(" ",n.resettingKey()===e.key?"Disconnecting\u2026":"Confirm"," "),QE(),pg("disabled",n.resettingKey()===e.key),fg("aria-label","Cancel disconnecting "+e.config.name);}}function ce(i,t){if(i&1){let e=sC();Is(0,"button",29),Eg("click",function(){mf(e);let r=dC(3).$implicit,d=dC(2);return yf(d.requestReset(r))}),HC(1," Disconnect "),ml();}if(i&2){let e=dC(3).$implicit,n=dC(2);pg("disabled",n.connectingKey()!==null),fg("aria-label","Disconnect "+e.config.name);}}function de(i,t){if(i&1){let e=sC();Is(0,"button",29),Eg("click",function(){mf(e);let r=dC(2).$implicit,d=dC(2);return yf(d.connect(r))}),HC(1),ml(),Yw(2,ce,2,2,"button",30);}if(i&2){let e=dC(2).$implicit,n=dC(2);pg("disabled",n.connectingKey()!==null||n.resettingKey()!==null),fg("aria-label",(n.connectionOf(e)==="connected"?"Reconnect ":"Connect ")+e.config.name),QE(),Il(" ",n.connectionOf(e)==="connected"?"Reconnect":"Connect"," "),QE(),Qw(n.connectionOf(e)==="connected"?2:-1);}}function pe(i,t){if(i&1&&Yw(0,re,4,1)(1,le,6,5)(2,de,3,4),i&2){let e=dC().$implicit,n=dC(2);Qw(n.connectingKey()===e.key?0:n.resetConfirmingKey()===e.key?1:n.deletion.confirmingId()!==e.key?2:-1);}}function ue(i,t){if(i&1){let e=sC();Is(0,"button",27),Eg("click",function(){mf(e);let r=dC().$implicit,d=dC(2);return yf(d.duplicate(r))}),HC(1," Duplicate "),ml();}if(i&2){let e=dC().$implicit;fg("aria-label","Duplicate "+e.config.name);}}function _e(i,t){if(i&1){let e=sC();Is(0,"button",27),Eg("click",function(){mf(e);let r=dC(2).$implicit,d=dC(2);return yf(d.edit(r))}),HC(1," Edit "),ml();}if(i&2){let e=dC(2).$implicit;fg("aria-label","Edit "+e.config.name);}}function me(i,t){if(i&1){let e=sC();Yw(0,_e,2,1,"button",24),Is(1,"agentos-row-delete-action",31),Eg("deleteRequested",function(){mf(e);let r=dC().$implicit,d=dC(2);return yf(d.deletion.request(r.key))})("deleteConfirmed",function(){mf(e);let r=dC().$implicit,d=dC(2);return yf(d.confirmDelete(r))})("deleteCancelled",function(){mf(e);let r=dC(3);return yf(r.deletion.cancel())}),ml();}if(i&2){let e=dC().$implicit,n=dC(2);Qw(n.deletion.confirmingId()!==e.key?0:-1),QE(),pg("rowKey",e.key)("rowLabel",e.config.name)("state",n.deletion);}}function ge(i,t){i&1&&(Is(0,"button",25),HC(1,"Inherited"),ml());}function he(i,t){if(i&1&&(Is(0,"tr",10)(1,"td",13),HC(2),ml(),Is(3,"td",14),HC(4),ml(),Is(5,"td",15)(6,"div",16)(7,"ds-tag",17),HC(8),ml(),Yw(9,ie,2,0,"ds-tag",18),ml()(),Is(10,"td",19),Yw(11,oe,2,0,"ds-tag",20)(12,ae,2,0,"ds-tag",18)(13,se,2,0,"span",21),ml(),Is(14,"td",22)(15,"div",23),Yw(16,pe,3,1),Yw(17,ue,2,1,"button",24),Yw(18,me,2,4)(19,ge,2,0,"button",25),ml()()()),i&2){let e=t.$implicit,n=dC(2);QE(2),Lg(e.config.name),QE(2),Il(" ",e.config.authType," "),QE(3),pg("variant",e.scopeLabel==="Platform"?"neutral":e.scopeLabel==="Personal"?"outline":"accent"),QE(),Lg(e.scopeLabel),QE(),Qw(e.canMutate?-1:9),QE(2),Qw(n.isOAuth(e)&&n.connectionOf(e)==="connected"?11:n.isOAuth(e)&&n.connectionOf(e)==="disconnected"?12:13),QE(5),Qw(n.isOAuth(e)?16:-1),QE(),Qw(n.deletion.confirmingId()!==e.key&&n.resetConfirmingKey()!==e.key&&n.connectingKey()!==e.key?17:-1),QE(),Qw(e.canMutate?18:19);}}function Ce(i,t){if(i&1&&(Is(0,"div",7)(1,"table",8)(2,"thead",9)(3,"tr",10)(4,"th",11),HC(5,"Name"),ml(),Is(6,"th",11),HC(7,"Authentication type"),ml(),Is(8,"th",11),HC(9,"Scope"),ml(),Is(10,"th",11),HC(11,"Connection"),ml(),Is(12,"th",11)(13,"span",12),HC(14,"Actions"),ml()()()(),Is(15,"tbody",9),Jw(16,he,20,9,"tr",10,Q),ml()()()),i&2){let e=dC();QE(16),eC(e.rowFilter.filteredRows());}}var fe=new Set(["OAuthDiscoverableAuthSetting","OAuthMcpDiscoverableAuthSetting","OAuthCustomAuthSetting","OAuthRegisteredAuthSetting"]),J=class i{route=g(W);router=g(F);destroyRef=g(we);state=g(I);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=zi(false);isLoading=zi(true);rows=zi([]);deletion=k();connections=zi({});connectingKey=zi(null);resetConfirmingKey=zi(null);resettingKey=zi(null);actionMessage=zi(null);connectAttempt=null;connectPopup=null;connectionsLoad=null;rowFilter=O(this.rows,t=>[t.config.name,t.config.authType,t.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U(this.destroyRef)).subscribe(t=>{let e=t.get("namespaceId")??"";e&&e!==this.namespaceId&&(this.namespaceId=e),this.state.setNamespace(e);}),this.route.paramMap.pipe(ne$1(t=>t.get("namespaceId")??""),ma(t=>t?this.namespaceRole.isAdminOfNamespace$(t):_r(false)),U(this.destroyRef)).subscribe(t=>this.isAdmin.set(t)),this.state.vm$.pipe(U(this.destroyRef)).subscribe({next:t=>{this.rows.set(this.toRows(t)),this.isLoading.set(false),this.loadConnections();},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(t){!t.canMutate||!t.config.id||this.router.navigate(["/agentos",this.namespaceId,"auth-settings",t.config.id,"edit"],{queryParams:{scope:t.scope}});}confirmDelete(t){!t.canMutate||!t.config.id||this.deletion.execute(t.key,{request$:this.state.delete(t.config.id,t.scope).pipe(U(this.destroyRef)),errorMessage:`Deleting "${t.config.name}" failed. Try again.`});}isOAuth(t){return fe.has(t.config.authType)}connectionOf(t){return this.connections()[t.key]??"unknown"}connect(t){let e=t.config.id;if(!e||this.connectingKey()||this.resettingKey())return;let n=w();if(!n){this.actionMessage.set({kind:"error",text:"The browser blocked the authorization window. Allow pop-ups for this site and try again."});return}this.actionMessage.set(null),this.resetConfirmingKey.set(null),this.connectPopup=n,this.connectingKey.set(t.key),this.connectAttempt=this.state.connect(e,this.namespaceParam(),r=>n.location.href=r,()=>n.closed).pipe(di(()=>{this.connectingKey.set(null),this.connectAttempt=null,this.connectPopup=null;}),U(this.destroyRef)).subscribe({next:r=>this.onConnectOutcome(t,r,n),error:()=>{n.close(),this.actionMessage.set({kind:"error",text:`Connecting "${t.config.name}" failed. Check that its OAuth settings are complete, then try again.`});}});}cancelConnect(){this.connectAttempt?.unsubscribe(),this.connectPopup?.close();}requestReset(t){this.resettingKey()||this.connectingKey()||(this.actionMessage.set(null),this.resetConfirmingKey.set(t.key));}cancelReset(){this.resettingKey()||this.resetConfirmingKey.set(null);}confirmReset(t){let e=t.config.id;!e||this.resettingKey()||this.resetConfirmingKey()!==t.key||(this.resettingKey.set(t.key),this.state.resetCredential(e,this.namespaceParam()).pipe(U(this.destroyRef)).subscribe({next:()=>{this.resettingKey.set(null),this.resetConfirmingKey.set(null),this.loadConnections();},error:()=>{this.resettingKey.set(null),this.actionMessage.set({kind:"error",text:`Disconnecting "${t.config.name}" failed. Try again.`});}}));}duplicate(t){if(!t.config.id)return;let e=t.scope==="platform"||t.scope==="namespace"&&!this.isAdmin()?"userOnNs":t.scope;this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:e,template:t.config.id,templateScope:t.scope}});}onConnectOutcome(t,e,n){n.close(),this.loadConnections(),e==="abandoned"?this.actionMessage.set({kind:"info",text:`The authorization window was closed before "${t.config.name}" got connected.`}):e==="timeout"&&this.actionMessage.set({kind:"info",text:`No authorization was received for "${t.config.name}" in time. Try again.`});}namespaceParam(){return this.namespaceId||void 0}loadConnections(){this.connectionsLoad?.unsubscribe();let t=this.rows().filter(e=>this.isOAuth(e)&&e.config.id).map(e=>this.state.getConnection(e.config.id,this.namespaceParam()).pipe(ne$1(n=>[e.key,n.connected?"connected":"disconnected"]),ga(()=>_r([e.key,"unknown"]))));if(t.length===0){this.connections.set({});return}this.connectionsLoad=Ny(t).pipe(U(this.destroyRef)).subscribe(e=>this.connections.set(Object.fromEntries(e)));}toRows(t){return [...this.mapScope(t.platform,"platform","Platform",false),...this.mapScope(t.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(t.userOnNs,"userOnNs","Personal",true),...this.mapScope(t.userGlobal,"userGlobal","Personal",true)]}mapScope(t,e,n,r){return t.map((d,Y)=>({key:`${e}:${d.id??Y}`,config:d,scope:e,scopeLabel:n,canMutate:r}))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Nw({type:i,selectors:[["agentos-auth-settings-all-scopes"]],decls:10,vars:4,consts:[["title","Auth settings","description","Authentication settings available in this namespace, including inherited platform and personal entries."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],[3,"class"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Connection"],["variant","accent"],[1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["type","button","disabled",""],["role","status",1,"settings-table__confirm-label"],["type","button",3,"click"],[1,"settings-table__confirm-label"],["type","button",3,"click","disabled"],["type","button",3,"disabled"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(e,n){if(e&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(d){return n.rowFilter.query.set(d)}),ml(),Is(2,"button",2),Eg("click",function(){return n.openCreateForm()}),HC(3,"New auth setting"),ml()(),Yw(4,X,2,1,"p",3),Yw(5,Z,2,4,"p",4),Yw(6,ee,2,0,"p",5)(7,te,2,0,"p",6)(8,ne,2,0,"p",5)(9,Ce,18,0,"div",7)),e&2){let r;QE(),pg("query",n.rowFilter.query()),QE(3),Qw(n.deletion.error()?4:-1),QE(),Qw((r=n.actionMessage())?5:-1,r),QE(),Qw(n.isLoading()?6:n.rows().length===0?7:n.rowFilter.filteredRows().length===0?8:9);}},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{J as AuthSettingsAllScopesComponent};
@@ -1 +1 @@
1
- import {y,p as pt,T as Te,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,c as fo,g as go,R as Rn,E as Ea,v as vn,d as yn,e as fn,h as hn,k as dn,i as at,u as un,m as mn,A as Ao}from'./chunk-qF4-8qpt.js';import {g,K as we,W,J,z as zi,L as U,I as Iw,a as Is,f as fg,R as vg,H as Hw,b as gl,S as AI,O as OC,U as UE,Q as dg,c as Uw,T as OI,E as El,a4 as we$1,a5 as Dd,a6 as x,s as rC,X as Xw,F as Fg,a7 as Ln,t as hf,u as gf,G as Gw,j as Ww}from'./main-C2L5IBU7.js';var I=class e{api=g(we$1);isLoading=zi(false);result=zi(null);errorMessage=zi(null);invoke(t,n,o,l){return this.isLoading.set(true),this.result.set(null),this.errorMessage.set(null),this.api.invoke({namespaceId:t,userId:n||void 0,toolName:o,payload:l||void 0}).pipe(Dd({next:v=>{this.result.set(v),this.isLoading.set(false);},error:v=>{this.errorMessage.set(le(v)),this.isLoading.set(false);}}))}reset(){this.result.set(null),this.errorMessage.set(null);}static \u0275fac=function(n){return new(n||e)};static \u0275prov=x({token:e,factory:e.\u0275fac,providedIn:"root"})};function le(e){if(e instanceof Ln){let t=e.error;return t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:typeof t=="string"&&t.trim().length>0?t:e.statusText||`HTTP ${e.status}`}return e instanceof Error?e.message:"Unknown error"}var de=(e,t)=>t.id;function me(e,t){e&1&&(Is(0,"p",14),OC(1,"Loading namespaces\u2026"),gl());}function pe(e,t){if(e&1&&(Is(0,"option",17),OC(1),gl()),e&2){let n=t.$implicit;dg("value",n.id),UE(),Fg(n.name);}}function ce(e,t){if(e&1&&(Is(0,"select",15)(1,"option",16),OC(2,"Select a namespace"),gl(),Gw(3,pe,2,2,"option",17,de),gl(),AI()),e&2){let n=rC(2);OI(),UE(3),Ww(n.namespaces());}}function ue(e,t){if(e&1&&Hw(0,me,2,0,"p",14)(1,ce,5,0,"select",15),e&2){let n=rC();Uw(n.namespacesLoading()?0:1);}}function fe(e,t){if(e&1&&fg(0,"input",3),e&2){let n=rC();dg("value",n.namespaceName()??n.namespaceId);}}function ge(e,t){if(e&1){let n=Xw();Is(0,"button",18),vg("click",function(){hf(n);let l=rC();return gf(l.reset())}),OC(1,"Clear result"),gl();}}function ve(e,t){e&1&&(Is(0,"ds-card",12)(1,"pre",19),OC(2),gl()()),e&2&&(UE(2),Fg(t));}function ye(e,t){e&1&&(Is(0,"span",21),OC(1,"Metadata"),gl(),Is(2,"pre",19),OC(3),gl()),e&2&&(UE(3),Fg(t));}function Ce(e,t){if(e&1&&(Is(0,"dt"),OC(1,"Type"),gl(),Is(2,"dd",23),OC(3),gl()),e&2){let n=rC(2);UE(3),Fg(n.errorType);}}function _e(e,t){if(e&1&&(Is(0,"dt"),OC(1,"Message"),gl(),Is(2,"dd"),OC(3),gl()),e&2){let n=rC(2);UE(3),Fg(n.errorMessage);}}function be(e,t){if(e&1&&(Is(0,"span",21),OC(1,"Tool error details"),gl(),Is(2,"dl",22),Hw(3,Ce,4,1),Hw(4,_e,4,1),gl()),e&2){let n=rC();UE(3),Uw(n.errorType?3:-1),UE(),Uw(n.errorMessage?4:-1);}}function he(e,t){if(e&1&&(Is(0,"ds-card",13)(1,"div")(2,"ds-tag",20),OC(3),gl()(),Is(4,"span",21),OC(5,"Output"),gl(),Is(6,"pre",19),OC(7),gl(),Hw(8,ye,4,1),Is(9,"span",21),OC(10,"Structured output"),gl(),Is(11,"pre",19),OC(12),gl(),Hw(13,be,5,2),gl()),e&2){let n,o=t,l=rC();dg("heading","Result \u2014 "+o.toolName),UE(2),dg("variant",o.success?"accent":"outline"),UE(),Fg(o.success?"Success":"Tool error"),UE(4),Fg(o.output),UE(),Uw((n=l.formatMetadata(o.metadata))?8:-1,n),UE(4),Fg(l.formatStructuredOutput(o.structuredOutput)??"null"),UE(),Uw(o.errorType||o.errorMessage?13:-1);}}var re=class e{destroyRef=g(we);route=g(W);namespaceController=g(J);userState=g(y);state=g(I);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=zi([]);namespacesLoading=zi(true);namespaceName=zi(null);form=new pt({namespaceId:new Te("",{nonNullable:true,validators:[bn.required]}),userId:new Te("",{nonNullable:true}),toolName:new Te("",{nonNullable:true,validators:[bn.required]}),payload:new Te("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:n=>{n.id&&this.form.controls.userId.patchValue(n.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:n=>{this.namespaces.set(n.map(o=>({id:o.id,name:o.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:n=>this.namespaceName.set(n.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:n,toolName:o,payload:l}=this.form.getRawValue();this.state.invoke(t,n.trim()||void 0,o.trim(),l.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Iw({type:e,selectors:[["agentos-tool-invoke"]],decls:18,vars:8,consts:[["title","Tool invoke",3,"description"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Namespace","controlId","ti-namespace","required",""],["dsControl","","id","ti-namespace","type","text","readonly","",3,"value"],["label","User ID","labelHint","optional","controlId","ti-user"],["dsControl","","id","ti-user","type","text","formControlName","userId","placeholder","UUID of the user \u2014 adds user-scoped overlay layers","autocomplete","off"],["label","Tool name","controlId","ti-tool","required","","hint","Exact tool name as returned by the agent definition inspect page. When not found, the error response lists all available tools for the selected namespace."],["dsControl","","mono","","id","ti-tool","type","text","formControlName","toolName","placeholder","e.g. MY_FILES__listFiles","autocomplete","off","spellcheck","false"],["label","Payload","labelHint","optional","controlId","ti-payload"],["dsControl","","mono","","id","ti-payload","formControlName","payload","rows","6","placeholder",'JSON arguments for the tool, e.g. {"path": "/some/dir"} \u2014 leave empty for tools with no input.',"spellcheck","false"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button"],["heading","Error"],[3,"heading"],[1,"ds-hint"],["dsControl","","id","ti-namespace","formControlName","namespaceId"],["value","","disabled",""],[3,"value"],["dsButton","","type","button",3,"click"],[1,"ds-pre"],[3,"variant"],[1,"ds-micro"],["dsDefinitionList",""],[1,"ds-mono"]],template:function(n,o){if(n&1&&(Is(0,"ds-page"),fg(1,"ds-section-header",0),Is(2,"form",1),vg("ngSubmit",function(){return o.submit()}),Is(3,"ds-form-field",2),Hw(4,ue,2,1)(5,fe,1,1,"input",3),gl(),Is(6,"ds-form-field",4),fg(7,"input",5),AI(),gl(),Is(8,"ds-form-field",6),fg(9,"input",7),AI(),gl(),Is(10,"ds-form-field",8),fg(11,"textarea",9),AI(),gl(),Is(12,"ds-form-actions")(13,"button",10),OC(14),gl(),Hw(15,ge,2,0,"button",11),gl()(),Hw(16,ve,3,1,"ds-card",12),Hw(17,he,14,7,"ds-card",13),gl()),n&2){let l,v;UE(),dg("description",o.isPlatformMode?"Execute any registered tool directly \u2014 bypasses the normal agent-run pipeline. Restricted to super-admins.":"Execute a registered tool directly in this namespace \u2014 bypasses the normal agent-run pipeline."),UE(),dg("formGroup",o.form),UE(2),Uw(o.isPlatformMode?4:5),UE(3),OI(),UE(2),OI(),UE(2),OI(),UE(2),dg("disabled",o.form.invalid||o.state.isLoading()),UE(),El(" ",o.state.isLoading()?"Running\u2026":"Run tool"," "),UE(),Uw(o.state.result()||o.state.errorMessage()?15:-1),UE(),Uw((l=o.state.errorMessage())?16:-1,l),UE(),Uw((v=o.state.result())?17:-1,v);}},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Rn,Ea,vn,yn,fn,hn,dn,at,un,mn,Ao],encapsulation:2})};export{re as ToolInvokeComponent};
1
+ import {y,p as pt,T as Te,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,c as fo,g as go,R as Rn,E as Ea,v as vn,d as yn,e as fn,h as hn,k as dn,i as at,u as un,m as mn,A as Ao}from'./chunk-CV72_wbg.js';import {g,K as we,W,G as J,z as zi,U,N as Nw,I as Is,a as hg,R as Eg,Y as Yw,m as ml,S as BI,H as HC,Q as QE,P as pg,b as Qw,T as HI,o as Il,a4 as we$1,a5 as Ed,a6 as A,p as dC,s as sC,L as Lg,a7 as Ln,q as mf,r as yf,J as Jw,k as eC}from'./main-2W2EKPFF.js';var I=class e{api=g(we$1);isLoading=zi(false);result=zi(null);errorMessage=zi(null);invoke(t,n,o,l){return this.isLoading.set(true),this.result.set(null),this.errorMessage.set(null),this.api.invoke({namespaceId:t,userId:n||void 0,toolName:o,payload:l||void 0}).pipe(Ed({next:v=>{this.result.set(v),this.isLoading.set(false);},error:v=>{this.errorMessage.set(le(v)),this.isLoading.set(false);}}))}reset(){this.result.set(null),this.errorMessage.set(null);}static \u0275fac=function(n){return new(n||e)};static \u0275prov=A({token:e,factory:e.\u0275fac,providedIn:"root"})};function le(e){if(e instanceof Ln){let t=e.error;return t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:typeof t=="string"&&t.trim().length>0?t:e.statusText||`HTTP ${e.status}`}return e instanceof Error?e.message:"Unknown error"}var de=(e,t)=>t.id;function me(e,t){e&1&&(Is(0,"p",14),HC(1,"Loading namespaces\u2026"),ml());}function pe(e,t){if(e&1&&(Is(0,"option",17),HC(1),ml()),e&2){let n=t.$implicit;pg("value",n.id),QE(),Lg(n.name);}}function ce(e,t){if(e&1&&(Is(0,"select",15)(1,"option",16),HC(2,"Select a namespace"),ml(),Jw(3,pe,2,2,"option",17,de),ml(),BI()),e&2){let n=dC(2);HI(),QE(3),eC(n.namespaces());}}function ue(e,t){if(e&1&&Yw(0,me,2,0,"p",14)(1,ce,5,0,"select",15),e&2){let n=dC();Qw(n.namespacesLoading()?0:1);}}function fe(e,t){if(e&1&&hg(0,"input",3),e&2){let n=dC();pg("value",n.namespaceName()??n.namespaceId);}}function ge(e,t){if(e&1){let n=sC();Is(0,"button",18),Eg("click",function(){mf(n);let l=dC();return yf(l.reset())}),HC(1,"Clear result"),ml();}}function ve(e,t){e&1&&(Is(0,"ds-card",12)(1,"pre",19),HC(2),ml()()),e&2&&(QE(2),Lg(t));}function ye(e,t){e&1&&(Is(0,"span",21),HC(1,"Metadata"),ml(),Is(2,"pre",19),HC(3),ml()),e&2&&(QE(3),Lg(t));}function Ce(e,t){if(e&1&&(Is(0,"dt"),HC(1,"Type"),ml(),Is(2,"dd",23),HC(3),ml()),e&2){let n=dC(2);QE(3),Lg(n.errorType);}}function _e(e,t){if(e&1&&(Is(0,"dt"),HC(1,"Message"),ml(),Is(2,"dd"),HC(3),ml()),e&2){let n=dC(2);QE(3),Lg(n.errorMessage);}}function be(e,t){if(e&1&&(Is(0,"span",21),HC(1,"Tool error details"),ml(),Is(2,"dl",22),Yw(3,Ce,4,1),Yw(4,_e,4,1),ml()),e&2){let n=dC();QE(3),Qw(n.errorType?3:-1),QE(),Qw(n.errorMessage?4:-1);}}function he(e,t){if(e&1&&(Is(0,"ds-card",13)(1,"div")(2,"ds-tag",20),HC(3),ml()(),Is(4,"span",21),HC(5,"Output"),ml(),Is(6,"pre",19),HC(7),ml(),Yw(8,ye,4,1),Is(9,"span",21),HC(10,"Structured output"),ml(),Is(11,"pre",19),HC(12),ml(),Yw(13,be,5,2),ml()),e&2){let n,o=t,l=dC();pg("heading","Result \u2014 "+o.toolName),QE(2),pg("variant",o.success?"accent":"outline"),QE(),Lg(o.success?"Success":"Tool error"),QE(4),Lg(o.output),QE(),Qw((n=l.formatMetadata(o.metadata))?8:-1,n),QE(4),Lg(l.formatStructuredOutput(o.structuredOutput)??"null"),QE(),Qw(o.errorType||o.errorMessage?13:-1);}}var re=class e{destroyRef=g(we);route=g(W);namespaceController=g(J);userState=g(y);state=g(I);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=zi([]);namespacesLoading=zi(true);namespaceName=zi(null);form=new pt({namespaceId:new Te("",{nonNullable:true,validators:[bn.required]}),userId:new Te("",{nonNullable:true}),toolName:new Te("",{nonNullable:true,validators:[bn.required]}),payload:new Te("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:n=>{n.id&&this.form.controls.userId.patchValue(n.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:n=>{this.namespaces.set(n.map(o=>({id:o.id,name:o.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:n=>this.namespaceName.set(n.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:n,toolName:o,payload:l}=this.form.getRawValue();this.state.invoke(t,n.trim()||void 0,o.trim(),l.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Nw({type:e,selectors:[["agentos-tool-invoke"]],decls:18,vars:8,consts:[["title","Tool invoke",3,"description"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Namespace","controlId","ti-namespace","required",""],["dsControl","","id","ti-namespace","type","text","readonly","",3,"value"],["label","User ID","labelHint","optional","controlId","ti-user"],["dsControl","","id","ti-user","type","text","formControlName","userId","placeholder","UUID of the user \u2014 adds user-scoped overlay layers","autocomplete","off"],["label","Tool name","controlId","ti-tool","required","","hint","Exact tool name as returned by the agent definition inspect page. When not found, the error response lists all available tools for the selected namespace."],["dsControl","","mono","","id","ti-tool","type","text","formControlName","toolName","placeholder","e.g. MY_FILES__listFiles","autocomplete","off","spellcheck","false"],["label","Payload","labelHint","optional","controlId","ti-payload"],["dsControl","","mono","","id","ti-payload","formControlName","payload","rows","6","placeholder",'JSON arguments for the tool, e.g. {"path": "/some/dir"} \u2014 leave empty for tools with no input.',"spellcheck","false"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button"],["heading","Error"],[3,"heading"],[1,"ds-hint"],["dsControl","","id","ti-namespace","formControlName","namespaceId"],["value","","disabled",""],[3,"value"],["dsButton","","type","button",3,"click"],[1,"ds-pre"],[3,"variant"],[1,"ds-micro"],["dsDefinitionList",""],[1,"ds-mono"]],template:function(n,o){if(n&1&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Is(2,"form",1),Eg("ngSubmit",function(){return o.submit()}),Is(3,"ds-form-field",2),Yw(4,ue,2,1)(5,fe,1,1,"input",3),ml(),Is(6,"ds-form-field",4),hg(7,"input",5),BI(),ml(),Is(8,"ds-form-field",6),hg(9,"input",7),BI(),ml(),Is(10,"ds-form-field",8),hg(11,"textarea",9),BI(),ml(),Is(12,"ds-form-actions")(13,"button",10),HC(14),ml(),Yw(15,ge,2,0,"button",11),ml()(),Yw(16,ve,3,1,"ds-card",12),Yw(17,he,14,7,"ds-card",13),ml()),n&2){let l,v;QE(),pg("description",o.isPlatformMode?"Execute any registered tool directly \u2014 bypasses the normal agent-run pipeline. Restricted to super-admins.":"Execute a registered tool directly in this namespace \u2014 bypasses the normal agent-run pipeline."),QE(),pg("formGroup",o.form),QE(2),Qw(o.isPlatformMode?4:5),QE(3),HI(),QE(2),HI(),QE(2),HI(),QE(2),pg("disabled",o.form.invalid||o.state.isLoading()),QE(),Il(" ",o.state.isLoading()?"Running\u2026":"Run tool"," "),QE(),Qw(o.state.result()||o.state.errorMessage()?15:-1),QE(),Qw((l=o.state.errorMessage())?16:-1,l),QE(),Qw((v=o.state.result())?17:-1,v);}},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Rn,Ea,vn,yn,fn,hn,dn,at,un,mn,Ao],encapsulation:2})};export{re as ToolInvokeComponent};
@@ -1 +1 @@
1
- import {g,aJ as fe,a6 as x}from'./main-C2L5IBU7.js';var c=class r{api=g(fe);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
1
+ import {g,aJ as fe,a6 as A}from'./main-2W2EKPFF.js';var c=class r{api=g(fe);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};